- 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.
23 lines
646 B
C#
23 lines
646 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
using Microsoft.Extensions.Logging.Debug;
|
|
using Microsoft.Extensions.Logging.Console;
|
|
|
|
namespace ComplianceNFs.Monitor;
|
|
|
|
public static class LoggingBootstrapper
|
|
{
|
|
public static ServiceProvider CreateServiceProvider()
|
|
{
|
|
var services = new ServiceCollection();
|
|
services.AddLogging(builder =>
|
|
{
|
|
builder.AddDebug();
|
|
builder.AddConsole();
|
|
builder.SetMinimumLevel(LogLevel.Information);
|
|
});
|
|
// Register other services as needed
|
|
return services.BuildServiceProvider();
|
|
}
|
|
}
|