Package Usage: go: github.com/rs/zerolog
Package zerolog provides a lightweight logging library dedicated to JSON logging.
A global Logger can be use for simple logging:
NOTE: To import the global logger, import the "log" subpackage "github.com/rs/zerolog/log".
Fields can be added to log messages:
Create logger instance to manage different outputs:
Sub-loggers let you chain loggers with additional context:
Level logging
Customize automatic field names:
Log with no level and message:
Add contextual fields to global Logger:
Sample logs:
Log with contextual hooks:
Field duplication:
There is no fields deduplication out-of-the-box.
Using the same key multiple times creates new key in final JSON each time.
In this case, many consumers will take the last value,
but this is not guaranteed; check yours if in doubt.
Concurrency safety:
Be careful when calling UpdateContext. It is not concurrency safe. Use the With method to create a child logger:
51 versions
Latest release: plus d'un an ago
14 089 dependent packages
View more package details: https://packages.ecosystem.code.gouv.fr/registries/proxy.golang.org/packages/github.com/rs/zerolog
Dependent Repos 6
1024pix/steampipe-plugin-metabase
Use SQL to query databases, tables, permissions and more from MetabaseSize: 1,22 Mo - Last synced: 2 jours ago - Pushed: 3 jours ago

snps-public/cephfs-foldersize-exporter
Prometheus exporter for CephFS various folder sizesLast synced: 7 mois ago - Pushed: 11 mois ago
snps-public/rest-samba-config
Rest API used to view (and maybe at some point edit) Samba configurationLast synced: 7 mois ago - Pushed: 11 mois ago
1024pix/go-metabase Fork of grokify/go-metabase
Go Client SDK for Metabase - https://github.com/metabase/metabaseSize: 361 ko - Last synced: 2 jours ago - Pushed: 7 mois ago

1024pix/goauth Fork of grokify/goauth
Utility libraries for Go (aka Golang) API auth including OAuth 2, JWT, TLS Client Authentication and Basic Auth.Size: 737 ko - Last synced: 2 jours ago - Pushed: environ un an ago

MTES-MCT/filharmonic-api 📦
API of Fil'HarmonicSize: 870 ko - Last synced: 4 jours ago - Pushed: environ 6 ans ago
