Files
cybertron/pkg/log/zapConfig.go

28 lines
484 B
Go
Raw Permalink Normal View History

2024-12-21 18:18:23 +05:30
package log
import (
"encoding/json"
"go.uber.org/zap"
)
func NewCustomZapConfig() zap.Config {
rawJSON := []byte(`{
"level": "debug",
"development": false,
"sampling": {
"initial": 100,
"thereafter": 100
},
"disableCaller": true,
"encoding": "json",
"OutputPaths": ["stdout"],
"ErrorOutputPaths": ["stderr"]
}`)
var cfg zap.Config
if err := json.Unmarshal(rawJSON, &cfg); err != nil {
panic(err)
}
return cfg
}