Documentation ¶
Index ¶
- Variables
- func FromContext(ctx context.Context) *zap.Logger
- func New(appID string, cfg *Config) (*zap.Logger, error)
- func Setup(appID string, cfg *Config)
- func ToContext(ctx context.Context, logger *zap.Logger) context.Context
- func ZapFieldPkg(pkg string) zapcore.Field
- type BadgerLogger
- type Config
- type OutputEnum
- type OutputFileConfig
- type OutputValueError
- type PresetConfig
- type PresetEnum
- type PresetValueError
Constants ¶
This section is empty.
Variables ¶
View Source
var Zap *zap.Logger //nolint:gochecknoglobals
Functions ¶
func ZapFieldPkg ¶
Types ¶
type BadgerLogger ¶
type BadgerLogger struct {
// contains filtered or unexported fields
}
func NewBadgerLogger ¶
func NewBadgerLogger(log *zap.Logger) *BadgerLogger
func (*BadgerLogger) Debugf ¶
func (l *BadgerLogger) Debugf(s string, i ...interface{})
func (*BadgerLogger) Errorf ¶
func (l *BadgerLogger) Errorf(s string, i ...interface{})
func (*BadgerLogger) Infof ¶
func (l *BadgerLogger) Infof(s string, i ...interface{})
func (*BadgerLogger) Warningf ¶
func (l *BadgerLogger) Warningf(s string, i ...interface{})
type Config ¶
type Config struct { Preset PresetEnum `yaml:"preset" env:"PRESET" env-default:"production"` Development PresetConfig `yaml:"development" env-prefix:"DEVELOPMENT_"` Production PresetConfig `yaml:"production" env-prefix:"PRODUCTION_"` }
type OutputEnum ¶
type OutputEnum int
const ( OutputUnknown OutputEnum = iota // unknown OutputStdout OutputEnum = iota // stdout OutputStderr OutputEnum = iota // stderr OutputFile OutputEnum = iota // file )
func OutputFromString ¶
func OutputFromString(value string) OutputEnum
func (OutputEnum) MarshalText ¶
func (e OutputEnum) MarshalText() ([]byte, error)
func (*OutputEnum) SetValue ¶
func (e *OutputEnum) SetValue(value string) error
func (OutputEnum) String ¶
func (i OutputEnum) String() string
func (*OutputEnum) UnmarshalText ¶
func (e *OutputEnum) UnmarshalText(text []byte) error
type OutputFileConfig ¶
type OutputValueError ¶
type OutputValueError struct {
Value string
}
func (*OutputValueError) Error ¶
func (e *OutputValueError) Error() string
type PresetConfig ¶
type PresetConfig struct { Level string `yaml:"level" env:"LEVEL" env-default:""` EnableCaller bool `yaml:"enableCaller" env:"ENABLE_CALLER" env-default:"false"` DisableStacktrace bool `yaml:"disableStacktrace" env:"DISABLE_STACKTRACE" env-default:"false"` LevelEncoder string `yaml:"levelEncoder" env:"LEVEL_ENCODER" env-default:""` TimeEncoder string `yaml:"timeEncoder" env:"TIME_ENCODER" env-default:""` TimeLayout string `yaml:"timeLayout" env:"TIME_LAYOUT" env-default:""` DurationEncoder string `yaml:"durationEncoder" env:"DURATION_ENCODER" env-default:"string"` Outputs map[OutputEnum]bool `yaml:"outputs" env:"OUTPUTS" env-default:""` OutputFile OutputFileConfig `yaml:"outputFile" env-prefix:"OUTPUT_FILE_"` }
type PresetEnum ¶
type PresetEnum int
const ( PresetUnknown PresetEnum = iota // unknown PresetDevelopment PresetEnum = iota // development PresetProduction PresetEnum = iota // production )
func PresetFromString ¶
func PresetFromString(value string) PresetEnum
func (PresetEnum) MarshalText ¶
func (e PresetEnum) MarshalText() ([]byte, error)
func (*PresetEnum) SetValue ¶
func (e *PresetEnum) SetValue(value string) error
func (PresetEnum) String ¶
func (i PresetEnum) String() string
func (*PresetEnum) UnmarshalText ¶
func (e *PresetEnum) UnmarshalText(text []byte) error
type PresetValueError ¶
type PresetValueError struct {
Value string
}
func (*PresetValueError) Error ¶
func (e *PresetValueError) Error() string
Click to show internal directories.
Click to hide internal directories.