mirror of
https://github.com/BlossomiShymae/Needlework.Net.git
synced 2025-12-06 10:10:48 +01:00
feat: change time format and ext for logs
This commit is contained in:
@@ -12,7 +12,7 @@ namespace Needlework.Net
|
|||||||
{
|
{
|
||||||
var logger = new LoggerConfiguration()
|
var logger = new LoggerConfiguration()
|
||||||
.MinimumLevel.Debug()
|
.MinimumLevel.Debug()
|
||||||
.WriteTo.File("Logs/debug-", rollingInterval: RollingInterval.Day, shared: true)
|
.WriteTo.File("Logs/debug-.log", rollingInterval: RollingInterval.Day, shared: true)
|
||||||
.CreateLogger();
|
.CreateLogger();
|
||||||
logger.Debug("NeedleworkDotNet version: {Version}", Assembly.GetEntryAssembly()?.GetName().Version?.ToString() ?? "0.0.0.0");
|
logger.Debug("NeedleworkDotNet version: {Version}", Assembly.GetEntryAssembly()?.GetName().Version?.ToString() ?? "0.0.0.0");
|
||||||
logger.Debug("OS description: {Description}", System.Runtime.InteropServices.RuntimeInformation.OSDescription);
|
logger.Debug("OS description: {Description}", System.Runtime.InteropServices.RuntimeInformation.OSDescription);
|
||||||
@@ -21,7 +21,7 @@ namespace Needlework.Net
|
|||||||
|
|
||||||
public static void LogFatal(UnhandledExceptionEventArgs e)
|
public static void LogFatal(UnhandledExceptionEventArgs e)
|
||||||
{
|
{
|
||||||
File.WriteAllText($"Logs/fatal-{DateTime.Now:HHmmssfff}", e.ExceptionObject.ToString());
|
File.AppendAllText($"Logs/fatal-{DateTime.Now:yyyyMMdd}.log", e.ExceptionObject.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user