baseline: 小军 WMS 二开代码原始快照(含 SynOABusiness.cs Debugger.Break)
This commit is contained in:
commit
c2b0e7be0d
6522 files changed
+3530643
No files matched your search
+23
@@ -0,0 +1,23 @@
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Serilog.Events;
|
||||
using System.IO;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.Infrastructure
|
||||
{
|
||||
public class SkynetLoggerFormatter : Serilog.Formatting.ITextFormatter
|
||||
{
|
||||
public void Format(LogEvent logEvent, TextWriter output)
|
||||
{
|
||||
output.WriteLine($"{logEvent.Timestamp.ToString("yyyy-MM-dd HH:mm:ss.fff")} {GetSkynetLevel(logEvent.Level)} {logEvent.MessageTemplate.Render(logEvent.Properties)}");
|
||||
if (logEvent.Exception != null)
|
||||
{
|
||||
output.WriteLine(logEvent.Exception);
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetSkynetLevel(LogEventLevel level)
|
||||
{
|
||||
return level == LogEventLevel.Information || level == LogEventLevel.Warning ? level.ToString().Left(4) : level.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user