Registry / logging / rs-zerolog

rs-zerolog

JSON →
library1.35.1gogounverified

Package zerolog provides a lightweight logging library dedicated to JSON logging.

go get github.com/rs/zerolog
INSTALL
IMPORT
SIG · RS-ZEROLOG
R
rs-zerolog
logginggov1.35.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

zerolog
github.com/rs/zerolog

Creates a zerolog logger that writes JSON-formatted log messages to stdout.

package main import ( "github.com/rs/zerolog" "os" ) func main() { logger := zerolog.New(os.Stdout).With().Timestamp().Logger() logger.Info().Msg("Hello, World!") }
Debug
Known issues
gotchaZerolog uses a global logger by default; forgetting to configure it may lead to unexpected output.
fix
Always initialize a logger explicitly using zerolog.New() or zerolog.NewConsoleWriter() to control output destination and format.
affects: >=1.0.0
Upgrade
Version history
1.35.1latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
34 hits · last 30 days
node
30
OpenAI (training)
1
Resources
rs-zerolog — go get rs-zerolog · libregistry