mirror of
https://github.com/DeBrosOfficial/network.git
synced 2025-10-06 12:29:07 +00:00
18 lines
526 B
Go
18 lines
526 B
Go
package pubsub
|
|
|
|
import "go.uber.org/zap"
|
|
|
|
// newPubSubLogger creates a zap.Logger for pubsub components.
|
|
// Quiet mode can be handled by callers by using production config externally;
|
|
// here we default to development logger for richer diagnostics during dev.
|
|
func newPubSubLogger(quiet bool) (*zap.Logger, error) {
|
|
if quiet {
|
|
cfg := zap.NewProductionConfig()
|
|
cfg.Level = zap.NewAtomicLevelAt(zap.WarnLevel)
|
|
cfg.DisableCaller = true
|
|
cfg.DisableStacktrace = true
|
|
return cfg.Build()
|
|
}
|
|
return zap.NewDevelopment()
|
|
}
|