logger
v0.1.8
github.com/takama/grpc/pkg/logger
Documentation
pkg.go.dev ↗Functions
New
func New(cfg *Config) *zap.Logger
New creates and configure new zap logger. nolint: funlen
ZapLevelConverter
func ZapLevelConverter(level Level) zapcore.Level
Types
Config
type Config struct {
Format string
Level Level
Time bool
Out zapcore.WriteSyncer
Err zapcore.WriteSyncer
}
Config contains params to setup logger.
Formatter
type Formatter int
Formatter defines output formatter.
TextFormatter (2 declarations)
const ( TextFormatter Formatter = iota JSONFormatter )
Format of outputs.
Formatter.String
func (f Formatter) String() string
Level
type Level int8
Level defines log levels.
LevelDebug (6 declarations)
const ( LevelDebug Level = iota LevelInfo LevelWarn LevelError LevelFatal LevelPanic )
Log levels.
Level.String
func (l Level) String() string