Registry / logging / zap
library1.28.0gogounverified

Package zap provides fast, structured, leveled logging.

go get go.uber.org/zap
INSTALL
IMPORT
SIG · ZAP
Z
zap
logginggov1.28.0
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.

zap
go.uber.org/zap

Create a production logger and log a message

package main import ( "go.uber.org/zap" ) func main() { logger, _ := zap.NewProduction() defer logger.Sync() logger.Info("hello world", zap.String("key", "value")) }
Debug
Known issues
gotchazap.Logger must be synced before the program exits to flush buffered logs
fix
Call logger.Sync() via defer or at exit
affects: >=1.0.0
Upgrade
Version history
1.28.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
29 hits · last 30 days
node
26
Resources
zap — go get zap · libregistry