Documentation ¶
Index ¶
- func FormatNames() []string
- func LevelNames() []string
- type Format
- func (i Format) IsAFormat() bool
- func (i Format) LogRUsFormatter() logrus.Formatter
- func (i Format) MarshalJSON() ([]byte, error)
- func (i Format) MarshalText() ([]byte, error)
- func (i Format) MarshalYAML() (interface{}, error)
- func (i *Format) Scan(value interface{}) error
- func (i Format) String() string
- func (i *Format) UnmarshalJSON(data []byte) error
- func (i *Format) UnmarshalText(text []byte) error
- func (i *Format) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (i Format) Value() (driver.Value, error)
- func (i Format) ZapEncoder(cfg zapcore.EncoderConfig) zapcore.Encoder
- type Level
- func (i Level) IsALevel() bool
- func (i Level) LogRUs() logrus.Level
- func (i Level) MarshalJSON() ([]byte, error)
- func (i Level) MarshalText() ([]byte, error)
- func (i Level) MarshalYAML() (interface{}, error)
- func (i *Level) Scan(value interface{}) error
- func (i Level) String() string
- func (i *Level) UnmarshalJSON(data []byte) error
- func (i *Level) UnmarshalText(text []byte) error
- func (i *Level) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (i Level) Value() (driver.Value, error)
- func (i Level) Zap() zapcore.Level
- type Logger
- type Option
- type Preset
- type WriteSyncer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatNames ¶ added in v1.1.1
func FormatNames() []string
func LevelNames ¶ added in v1.1.1
func LevelNames() []string
Types ¶
type Format ¶ added in v1.1.0
type Format int
const ( DefaultFormat = FormatText FormatText Format = iota FormatJSON )
func FormatString ¶ added in v1.1.1
FormatString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func FormatValues ¶ added in v1.1.1
func FormatValues() []Format
FormatValues returns all values of the enum
func ParseFormat ¶ added in v1.1.1
func (Format) IsAFormat ¶ added in v1.1.1
IsAFormat returns "true" if the value is listed in the enum definition. "false" otherwise
func (Format) LogRUsFormatter ¶ added in v1.1.0
func (Format) MarshalJSON ¶ added in v1.1.1
MarshalJSON implements the json.Marshaler interface for Format
func (Format) MarshalText ¶ added in v1.1.1
MarshalText implements the encoding.TextMarshaler interface for Format
func (Format) MarshalYAML ¶ added in v1.1.1
MarshalYAML implements a YAML Marshaler for Format
func (*Format) UnmarshalJSON ¶ added in v1.1.1
UnmarshalJSON implements the json.Unmarshaler interface for Format
func (*Format) UnmarshalText ¶ added in v1.1.1
UnmarshalText implements the encoding.TextUnmarshaler interface for Format
func (*Format) UnmarshalYAML ¶ added in v1.1.1
UnmarshalYAML implements a YAML Unmarshaler for Format
func (Format) ZapEncoder ¶ added in v1.1.0
func (i Format) ZapEncoder(cfg zapcore.EncoderConfig) zapcore.Encoder
type Level ¶ added in v1.1.0
type Level int
func LevelLogRUs ¶ added in v1.1.0
func LevelString ¶ added in v1.1.1
LevelString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func LevelValues ¶ added in v1.1.1
func LevelValues() []Level
LevelValues returns all values of the enum
func ParseLevel ¶ added in v1.1.1
func (Level) IsALevel ¶ added in v1.1.1
IsALevel returns "true" if the value is listed in the enum definition. "false" otherwise
func (Level) MarshalJSON ¶ added in v1.1.1
MarshalJSON implements the json.Marshaler interface for Level
func (Level) MarshalText ¶ added in v1.1.1
MarshalText implements the encoding.TextMarshaler interface for Level
func (Level) MarshalYAML ¶ added in v1.1.1
MarshalYAML implements a YAML Marshaler for Level
func (*Level) UnmarshalJSON ¶ added in v1.1.1
UnmarshalJSON implements the json.Unmarshaler interface for Level
func (*Level) UnmarshalText ¶ added in v1.1.1
UnmarshalText implements the encoding.TextUnmarshaler interface for Level
func (*Level) UnmarshalYAML ¶ added in v1.1.1
UnmarshalYAML implements a YAML Unmarshaler for Level
type Logger ¶
type Logger interface { Output() WriteSyncer SetOutput(WriteSyncer) Debug(args ...interface{}) Info(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) DPanic(args ...interface{}) Panic(args ...interface{}) Fatal(args ...interface{}) Debugf(template string, args ...interface{}) Infof(template string, args ...interface{}) Warnf(template string, args ...interface{}) Errorf(template string, args ...interface{}) DPanicf(template string, args ...interface{}) Panicf(template string, args ...interface{}) Fatalf(template string, args ...interface{}) Debugw(msg string, keysAndValues ...interface{}) Infow(msg string, keysAndValues ...interface{}) Warnw(msg string, keysAndValues ...interface{}) Errorw(msg string, keysAndValues ...interface{}) DPanicw(msg string, keysAndValues ...interface{}) Panicw(msg string, keysAndValues ...interface{}) Fatalw(msg string, keysAndValues ...interface{}) StdLogger() *log.Logger Format() Format SetFormat(Format) Level() Level SetLevel(Level) LogRUsLogger() *logrus.Logger ZapLogger() *zap.Logger ZapSugaredLogger() *zap.SugaredLogger With(args ...interface{}) Logger }
type Option ¶
type Option func(*logger)
func WithFormat ¶ added in v1.1.0
func WithOutput ¶ added in v1.1.0
func WithOutput(syncer WriteSyncer) Option
func WithPreset ¶ added in v1.1.0
func WithZapAtomicLevel ¶ added in v1.1.0
func WithZapAtomicLevel(atomicLevel zap.AtomicLevel) Option
func WithZapSugared ¶ added in v1.0.0
func WithZapSugared(sugar *zap.SugaredLogger) Option
type Preset ¶ added in v1.1.0
type Preset int
const ( DefaultPreset = PresetProduction PresetDevelopment Preset = iota PresetProduction )
func (Preset) ZapEncoderConfig ¶ added in v1.1.0
func (i Preset) ZapEncoderConfig() zapcore.EncoderConfig
type WriteSyncer ¶ added in v1.1.0
type WriteSyncer = zapcore.WriteSyncer