Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't colorize timestamp component of log format string #85

Open
3 of 8 tasks
fourpastmidnight opened this issue Mar 27, 2020 · 0 comments
Open
3 of 8 tasks

Can't colorize timestamp component of log format string #85

fourpastmidnight opened this issue Mar 27, 2020 · 0 comments

Comments

@fourpastmidnight
Copy link

Does this issue relate to a new feature or an existing bug?

  • Bug
  • New Feature

Not sure that this is a "bug" per se, it may be considered a missing "feature".

What version of Serilog Console Sink is affected by this issue? Please list the related NuGet package.

v3.1.1

What is the target framework and operating system affected by this issue? Please see target frameworks & net standard matrix.

  • netCore 3.1
  • netCore 2.0
  • netCore 1.0
  • 4.7
  • 4.6.x
  • 4.5.x

Please describe the current behaviour you are experiencing?

I created a custom ANSI color theme. I noticed that the timestamp component of the output template format string was not colorized. I tried the following:

{
  "Serilog": {
    "WriteTo": [
      {
        "Name": "Console",
        "Args": {
          "theme": "Full Qualified Class Name of my theme",
          "outputTemplate": "[\u001b[38;2;104;153;106m{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj} {Properties:j}{Newline}{Exception}"
        }
      }
    ]
  }
}

Please describe the expected behaviour if the ?

I expected that the timestamp component would be come an aqua green color (from Gruvbox Dark). Instead, the timestamp component remained the standard default terminal text color.

Suggested way to fix/add feature

Perhaps a new ConsoleThemeStyle field could be added: Timestamp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant