question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Hi there! Iā€™m in love with your zero allocation implementation since Iā€™m a big fan of Span and stackalloc šŸ˜ƒ I was in the process of doing that myself and stumble upon your great framework. And then I had a thought: It would be super great to have a ZeroLog.Core nuget implementing the core of a logging framework, then all the existing logging framework could re-implement their string management with this package and boom, you made the world sustainable again!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ltrzesniewskicommented, Aug 4, 2022

Actually, it doesnā€™t emit IL at runtime. v1 did that, but we removed it in v2.

The IL you see is ā€œemittedā€ at compile time (see https://github.com/ltrzesniewski/InlineIL.Fody).

2reactions
ltrzesniewskicommented, Aug 4, 2022

Well, in that case, I think ZeroLog already does what you want. šŸ™‚

You can consider its primary job is the first point you mention, but it is still designed to be extensible (your second point):

  • You can supply your own appender that derives from ZeroLog.Appenders.Appender (or StreamAppender) if you need to add a new sink.
  • You can supply your own formatter ZeroLog.Formatting.Formatter if you need another log format. We may implement logfmt or ndjson formats in the future.

As for your first point, there are a few ways to extend it as well:

  • You can write extension methods on LogMessage for your own types (we have a few of those in our codebase).
  • You can use an LogMessage.AppendOperation<T> in interpolated strings.

Thatā€™s something I should document I suppose. šŸ™‚

Read more comments on GitHub >

github_iconTop Results From Across the Web

obsidiandynamics/zerolog: Low-overhead logging faƧade ...
Zerolog (abbreviated to Zlg) is a logging faƧade with two fundamental design ... You need the zerolog-core module and, typically, a binding module....
Read more >
ZeroLog 2.1.0
Version Downloads Last updated 2.1.0 1,649 6 months ago 2.1.0ā€‘pre3 119 6 months ago 2.1.0ā€‘pre2 213 7 months ago
Read more >
zerolog
Package zerolog provides a lightweight logging library dedicated to JSON ... The zerolog package provides a fast and simple logger dedicated to JSON...
Read more >
Why I Chose Zerolog Over Logrus for Go Logging : r/golang
Zerolog is a logging library that is designed to be fast, lightweight, and easy to use. It has a simple API that allows...
Read more >
Artifacts using Zerolog Core (8)
Artifacts using Zerolog Core (8) Ā· 1. Blackstrom Core5 usages Ā· 2. Meteor Common2 usages Ā· 3. Zerolog Bridge Hazelcast2 usages Ā· 4....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found