mirror of
https://github.com/MolotovCherry/virtual-display-rs.git
synced 2025-09-07 01:06:22 +00:00
26 lines
668 B
C#
26 lines
668 B
C#
using Serilog;
|
|
using System;
|
|
using System.IO;
|
|
|
|
namespace Virtual_Display_Driver_Control.Common;
|
|
class Logging {
|
|
public static void Initialize() {
|
|
var log = new LoggerConfiguration()
|
|
// Always log to debug regardless
|
|
.WriteTo.Debug();
|
|
|
|
// Write output log if not in debug mode
|
|
#if !DEBUG
|
|
log.WriteTo.File(Path.Combine(SettingsProvider.AppDir, "app.log"),
|
|
rollingInterval: RollingInterval.Day,
|
|
rollOnFileSizeLimit: true);
|
|
#endif
|
|
|
|
Log.Logger = log.CreateLogger();
|
|
}
|
|
|
|
public static void Dispose() {
|
|
Log.CloseAndFlush();
|
|
}
|
|
}
|