mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-15 19:22:19 +08:00
CLI: Fix console color on Windows
This commit is contained in:
parent
b8a24e30bf
commit
3d511acf6a
|
@ -422,6 +422,10 @@ namespace BililiveRecorder.Cli
|
|||
|
||||
var matchMicrosoft = Matching.FromSource("Microsoft");
|
||||
|
||||
ConsoleTheme theme = OperatingSystem.IsWindows() && string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("WT_SESSION"))
|
||||
? SystemConsoleTheme.Literate
|
||||
: AnsiConsoleTheme.Code;
|
||||
|
||||
return new LoggerConfiguration()
|
||||
.MinimumLevel.Verbose()
|
||||
.Enrich.WithProcessId()
|
||||
|
@ -439,7 +443,7 @@ namespace BililiveRecorder.Cli
|
|||
x.FileCreationTime,
|
||||
x.FileModificationTime,
|
||||
})
|
||||
.WriteTo.Console(restrictedToMinimumLevel: logLevel, outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] [{RoomId}] {Message:lj}{NewLine}{Exception}", theme: AnsiConsoleTheme.Code)
|
||||
.WriteTo.Console(restrictedToMinimumLevel: logLevel, outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] [{RoomId}] {Message:lj}{NewLine}{Exception}", theme: theme)
|
||||
.WriteTo.Logger(sl =>
|
||||
{
|
||||
sl
|
||||
|
|
Loading…
Reference in New Issue
Block a user