Debug/Release loglevel, title
This commit is contained in:
@@ -64,13 +64,15 @@ public static class Program
|
||||
if (!Directory.Exists(logFolder)) Directory.CreateDirectory(logFolder);
|
||||
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
#if DEBUG || VERBOSE_LOGGING
|
||||
.MinimumLevel.Verbose()
|
||||
#endif
|
||||
.Enrich.FromLogContext()
|
||||
.WriteTo.File(
|
||||
Path.Combine(logFolder, "appLog.log"),
|
||||
fileSizeLimitBytes: 10 * 1024 * 1024,
|
||||
rollOnFileSizeLimit: true,
|
||||
rollingInterval: RollingInterval.Day)
|
||||
rollingInterval: RollingInterval.Day,
|
||||
rollOnFileSizeLimit: true)
|
||||
.CreateBootstrapLogger();
|
||||
}
|
||||
|
||||
@@ -82,9 +84,11 @@ public static class Program
|
||||
{
|
||||
#if DEBUG
|
||||
InitDevelopment();
|
||||
#else
|
||||
InitRelease();
|
||||
#endif
|
||||
if (AppDataRoot is null)
|
||||
{
|
||||
InitRelease();
|
||||
}
|
||||
InitLogging();
|
||||
|
||||
Log.Logger.Information("Early app starting...");
|
||||
|
||||
@@ -87,14 +87,16 @@ public static class Startup
|
||||
(serviceProvider, loggerConfiguration) =>
|
||||
{
|
||||
loggerConfiguration
|
||||
#if DEBUG || VERBOSE_LOGGING
|
||||
.MinimumLevel.Verbose()
|
||||
#endif
|
||||
.ReadFrom.Configuration(serviceProvider.GetRequiredService<IConfiguration>())
|
||||
.Enrich.FromLogContext()
|
||||
.WriteTo.File(
|
||||
Path.Combine(Program.AppDataRoot, "logs", "appLog.log"),
|
||||
fileSizeLimitBytes: 10 * 1024 * 1024,
|
||||
rollOnFileSizeLimit: true,
|
||||
rollingInterval: RollingInterval.Day)
|
||||
rollingInterval: RollingInterval.Day,
|
||||
rollOnFileSizeLimit: true)
|
||||
.WriteTo.Sink(serviceProvider.GetRequiredService<ToastMessageSink>());
|
||||
}
|
||||
);
|
||||
|
||||
@@ -55,6 +55,9 @@ public partial class MainWindowViewModel : IMainWindowViewModel
|
||||
}
|
||||
|
||||
Title = "FileTime " + versionString;
|
||||
#if DEBUG
|
||||
Title += " (Debug)";
|
||||
#endif
|
||||
|
||||
Task.Run(async () => await _lifecycleService.InitStartupHandlersAsync()).Wait();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user