-
Notifications
You must be signed in to change notification settings - Fork 5
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
Render Spectre markup in log messages #31
Comments
@caesay - this would not be hard to implement as a configuration, however I feel compelled to discuss. The pure intention of the library is to keep Spectre markup out of logging statements. Can you help me understand the use case of leveraging an abstraction over |
I am working on velopack, and all of the core libraries only take a dependency on msft logging, and try to avoid directly using spectre references at all costs, but they do also use spectre markup in the log messages themselves. This feels to me like a good balance, because I can then swap out the logging pipeline to a non-Spectre one without things breaking, and even strip out the markup. Some of the libraries are even intended for use in consuming applications, so having a very high level general abstraction like msft ilogger is important. I came across this library because there are not many great ways to use Spectre with ILogger. Having tried pretty much everything I can find, most libraries trying to do this are riddled with bugs - and indeed I ran into a few using this project related to using Spectre progress bars in conjunction with logging, so I ended up just writing my own simple Serilog Sink instead - as it seems to solve all the bugs and keeps things really simple. If you don't think this suggestion would be useful to others, feel free to close this issue. |
I will experiment with adding a property called Thanks for the input, always appreciated. |
Hi 🙌 Thanks a lot for the library, very helpful !! As said by @caesay, it would be helpful to write formatted logs into the regular ILogger, without applying complex formatting setup, leveraging on the very simple spectre built-in markup language Thanks again ! |
@caesay @GuillaumeGuerra - please see the referenced commit, new dev package will be pushing |
will check it out asap thanks alot ! @daningalla 🙏 |
works like a charm 👍 |
Thanks for using @GuillaumeGuerra! |
Becuase of this line:
vertical-spectreconsolelogger/src/Output/WriteBufferExtensions.cs
Line 64 in d0913f7
It's not possible to pass through Spectre markup in log messages when building rich console applications. It would be nice if this was configurable.
The text was updated successfully, but these errors were encountered: