serilog-sinks-console
serilog-sinks-console copied to clipboard
add Dracula Theme
Hi Joe! I should clarify, sorry - I meant some screenshots in the PR description, not in the repository itself. My apologies for the confusion.
Hi Joe! I should clarify, sorry - I meant some screenshots in the PR description, not in the repository itself. My apologies for the confusion.
Thanks for the updates. The colors in the theme look like a mix from different versions of the palette - is it possible to use only one of the sets, e.g. just the ANSI-256 version?
Modelling the theme on the VSCode one, or another text + data theme, might be useful. For readability, the main text content should probably be in the whitish shade that they've used there.
Hi @joesdu, thanks for all of the effort.
The theme still appears to have some contrast issues; I noticed that Dracula uses the white-ish shade for foreground text, and the unreadable gray is "comment"; I wonder if the output would be more readable if the messages were rendered in the white, and the cyan shade used for stack trace continuation lines?
(This might still leave green for INF?)
Hi @joesdu, thanks for all of the effort.
The theme still appears to have some contrast issues; I noticed that Dracula uses the white-ish shade for foreground text, and the unreadable gray is "comment"; I wonder if the output would be more readable if the messages were rendered in the white, and the cyan shade used for stack trace continuation lines?
(This might still leave green for INF?)
Yes, there are problems when it's not a dark theme.
Sad to see this closed @joesdu; it's definitely not my department but these problems do seem surmountable? Ultimately Nick is just asking these questions from the point of view of getting a truly workable implementation on the first try - getting obvious tweaking done in one shot rather than as a series of chaser releases...
Sad to see this closed @joesdu; it's definitely not my department but these problems do seem surmountable? Ultimately Nick is just asking these questions from the point of view of getting a truly workable implementation on the first try - getting obvious tweaking done in one shot rather than as a series of chaser releases...
Dracula Theme does not seem to have an example of a light theme. I checked the theme configurations of Windows Terminal and Notepad++, and it only contains dark themes, so it may not be applicable to the light theme version. So I closed this PR, if it is used If you have a dark theme and need to customize the theme color, you can use the following code to achieve it.
builder.Host.UseSerilog((hbc, lc) =>
{
const LogEventLevel logLevel = LogEventLevel.Information;
lc.ReadFrom.Configuration(hbc.Configuration)
.MinimumLevel.Override("Microsoft", logLevel)
.MinimumLevel.Override("System", logLevel)
.Enrich.FromLogContext()
.WriteTo.Async(wt =>
{
if (hbc.HostingEnvironment.IsDevelopment())
{
//wt.SpectreConsole();
wt.Debug();
}
wt.Console(theme: new AnsiConsoleTheme(new Dictionary<ConsoleThemeStyle, string>
{
[ConsoleThemeStyle.Text] = "\x1b[38;5;151m",
[ConsoleThemeStyle.SecondaryText] = "\x1b[38;5;245m",
[ConsoleThemeStyle.TertiaryText] = "\x1b[38;5;244m",
[ConsoleThemeStyle.Invalid] = "\x1b[38;5;214m",
[ConsoleThemeStyle.Null] = "\x1b[38;5;248m",
[ConsoleThemeStyle.Name] = "\x1b[38;5;141m",
[ConsoleThemeStyle.String] = "\x1b[38;5;168m",
[ConsoleThemeStyle.Number] = "\x1b[38;5;141m",
[ConsoleThemeStyle.Boolean] = "\x1b[38;5;248m",
[ConsoleThemeStyle.Scalar] = "\x1b[38;5;119m",
[ConsoleThemeStyle.LevelVerbose] = "\x1b[37m",
[ConsoleThemeStyle.LevelDebug] = "\x1b[37m",
[ConsoleThemeStyle.LevelInformation] = "\x1b[37;1m",
[ConsoleThemeStyle.LevelWarning] = "\x1b[38;5;208m",
[ConsoleThemeStyle.LevelError] = "\x1b[38;5;197m\x1b[48;5;238m",
[ConsoleThemeStyle.LevelFatal] = "\x1b[38;5;197m\x1b[48;5;238m"
}));
});
});