- Added Microsoft.Extensions.Logging to various projects for enhanced logging capabilities. - Updated AccessDbRepository and AttachmentRepository to include logging for database operations. - Integrated logging into MailListener for better error handling and operational insights. - Modified tests to utilize mocks for ILogger to ensure logging behavior is tested. - Enhanced App.xaml.cs and MainWindow.xaml.cs to log application startup and initialization events. - Created LoggingBootstrapper to configure logging services in the WPF application. - Updated TODOs-and-Roadmap.md to reflect the addition of logging features.
37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
using System.Text;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
using ComplianceNFs.Core.Application;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace ComplianceNFs.Monitor
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for MainWindow.xaml
|
|
/// </summary>
|
|
public partial class MainWindow : Window
|
|
{
|
|
private readonly ILogger<MainWindow>? _logger;
|
|
public MainWindow(ILogger<MainWindow> logger)
|
|
{
|
|
InitializeComponent();
|
|
_logger = logger;
|
|
DataContext = new MonitorViewModel(new DummyStatusStream());
|
|
_logger?.LogInformation("MainWindow initialized");
|
|
}
|
|
}
|
|
|
|
// Dummy implementation for design/runtime
|
|
public class DummyStatusStream : IInvoiceStatusStream
|
|
{
|
|
public event Action<Core.Entities.EnergyInvoice>? StatusUpdated { add { } remove { } }
|
|
public IEnumerable<Core.Entities.EnergyInvoice> GetRecent(int count = 100) => Array.Empty<Core.Entities.EnergyInvoice>();
|
|
}
|
|
} |