- LoggingIntegrationTests: verifies Serilog writes rolling log file with correct content - LogPanelSink structural smoke test: confirms type implements ILogEventSink - App.xaml.cs: added comment for LogPanelSink DI registration deferred to plan 01-06
43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Serilog;
|
|
using System.Windows;
|
|
|
|
namespace SharepointToolbox;
|
|
|
|
/// <summary>
|
|
/// Interaction logic for App.xaml
|
|
/// </summary>
|
|
public partial class App : Application
|
|
{
|
|
[STAThread]
|
|
public static void Main(string[] args)
|
|
{
|
|
using IHost host = Host.CreateDefaultBuilder(args)
|
|
.UseSerilog((ctx, cfg) => cfg
|
|
.WriteTo.File(
|
|
System.IO.Path.Combine(
|
|
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
|
"SharepointToolbox", "logs", "app-.log"),
|
|
rollingInterval: RollingInterval.Day,
|
|
retainedFileCountLimit: 30))
|
|
.ConfigureServices(RegisterServices)
|
|
.Build();
|
|
|
|
host.Start();
|
|
App app = new();
|
|
app.InitializeComponent();
|
|
app.MainWindow = host.Services.GetRequiredService<MainWindow>();
|
|
app.MainWindow.Visibility = Visibility.Visible;
|
|
app.Run();
|
|
}
|
|
|
|
private static void RegisterServices(HostBuilderContext ctx, IServiceCollection services)
|
|
{
|
|
// Placeholder — services registered in subsequent plans
|
|
services.AddSingleton<MainWindow>();
|
|
// LogPanelSink registered in plan 01-06 after MainWindow is created
|
|
// (requires RichTextBox reference from MainWindow)
|
|
}
|
|
}
|