Skip to content

xploitedd/loga

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LogA – Logging Adapters for Go

Sometimes go applications and libraries use more than one structured logging library, which makes logging unnecessarily difficult.

There has been a move to implement a std library logging library, which already exists under log/slog, however it's still common to see projects using zerolog or zap for performance or historical reasons.

In an attempt to still allow you to log stuff, this library provides simple adapters that you can use to convert between logging libraries.

Currently we support the following conversions:

Source Destination Adapter
Zap Zerolog loga.SlogToZerolog
Slog Zerolog loga.ZapToZerolog

Note that there may be a performance penalty of using these adapaters, as sometimes we may need to convert logging mechanisms that are not supported in the destination library (e.g., nested arrays in zerolog). However, we feel that having the performance penalty is better than not having logging, for most use cases.

Contributing

If you want to contribute to this project, firstly, let me thank you, and secondly, our structure is that each destination should have its own go file, like zerolog.go.

Every contribution should also be accompanied of some tests, to guarantee that the solution works and covers all use-cases. Currently, we don't have an extensive test coverage, but we aim to improve that in the future.

Acknowledgements

  • zerozap for much of the inspiration when converting from Zap to Zerolog.
  • All the logging libraries authors for their amazing work!

About

Logging Adapters for Go

Resources

License

Stars

Watchers

Forks

Packages

No packages published