slogger provides both well-formatted human-readable text output and Google Cloud optimized JSON output.
It is a lightweight custom logging package built on top of the Go standard library slog package, that
provides several options for severity-based logging.
If you're curious about the performance, check the benchmarks located in each benchmark directory.
The default is well-formatted text-based INFO level and higher output sent to stdout and stderr that is easy for humans to read and parse through.
With EnableCloudOutput(), logs are output in JSON format with some fields re-keyed to ensure proper recognition and formatting for Google Cloud Structured Logging. This prevents bloated and duplicated info in log entries.
With EnableDebugOutput(), debug-level messages are output, to console or Google Cloud, instead of being suppressed by default.
In console mode, the severity level of each log message is color-coded for easy recognition, and so things like WARN and ERROR messages stand out. This can be toggled off with DisableColoredOutput()
In console mode, each message with have the originating file and line number, making it easy to track down where the log message was generated. This can be toggled off with DisableFileOutput() if a user doesn't need it or prefers a cleaner look.
go get github.com/codenaugh/slogger