Documentation ¶
Index ¶
- Variables
- func AddLogger(name string, provider string, config string) error
- func Debug(msg string, fields ...zap.Field)
- func DebugWithSkip(skip int, msg string, fields ...zap.Field)
- func Error(msg string, fields ...zap.Field)
- func ErrorWithSkip(skip int, msg string, fields ...zap.Field)
- func Fatal(msg string, fields ...zap.Field)
- func FatalWithSkip(skip int, msg string, fields ...zap.Field)
- func Info(msg string, fields ...zap.Field)
- func InfoWithSkip(skip int, msg string, fields ...zap.Field)
- func Init()
- func New(config string) error
- func Register(name string, p Provider)
- func Reset() error
- func SetDefault(l *ZapTeeLogger)
- func Sync()
- func Warn(msg string, fields ...zap.Field)
- func WarnWithSkip(skip int, msg string, fields ...zap.Field)
- func ZapLogger() *zap.Logger
- type ConsoleLogger
- func (l *ConsoleLogger) Close() error
- func (l *ConsoleLogger) GetLevel() Level
- func (l *ConsoleLogger) GetStacktrackLevel() Level
- func (l *ConsoleLogger) Init(config string) error
- func (l *ConsoleLogger) Name() string
- func (l *ConsoleLogger) Sync() error
- func (l *ConsoleLogger) Write(p []byte) (int, error)
- type FileLogger
- type Level
- type Logger
- type Provider
- type ZapTeeLogger
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAlreadyClosed = errors.New("Logger is already closed") ErrAlreadyBuilded = errors.New("Logger is already builded") )
Functions ¶
func SetDefault ¶
func SetDefault(l *ZapTeeLogger)
Types ¶
type ConsoleLogger ¶
type ConsoleLogger struct { Level string `json:"level" yaml:"level"` StacktrackLevel string `json:"stackTrackLevel" yaml:"stackTrackLevel"` Stderr bool `json:"stderr" yaml:"stderr"` // contains filtered or unexported fields }
func (*ConsoleLogger) Close ¶
func (l *ConsoleLogger) Close() error
func (*ConsoleLogger) GetLevel ¶
func (l *ConsoleLogger) GetLevel() Level
func (*ConsoleLogger) GetStacktrackLevel ¶
func (l *ConsoleLogger) GetStacktrackLevel() Level
func (*ConsoleLogger) Init ¶
func (l *ConsoleLogger) Init(config string) error
func (*ConsoleLogger) Name ¶
func (l *ConsoleLogger) Name() string
func (*ConsoleLogger) Sync ¶
func (l *ConsoleLogger) Sync() error
type FileLogger ¶
type FileLogger struct { lumberjack.Logger Level string `json:"level" yaml:"level"` StacktrackLevel string `json:"stackTrackLevel" yaml:"stackTrackLevel"` // contains filtered or unexported fields }
func (*FileLogger) Close ¶
func (l *FileLogger) Close() error
func (*FileLogger) GetLevel ¶
func (l *FileLogger) GetLevel() Level
func (*FileLogger) GetStacktrackLevel ¶
func (l *FileLogger) GetStacktrackLevel() Level
func (*FileLogger) Init ¶
func (l *FileLogger) Init(config string) error
func (*FileLogger) Name ¶
func (l *FileLogger) Name() string
func (*FileLogger) Sync ¶
func (l *FileLogger) Sync() error
type Logger ¶
type Logger interface { Init(config string) error Write([]byte) (int, error) Sync() error Name() string GetLevel() Level GetStacktrackLevel() Level Close() error }
func NewConsoleLogger ¶
func NewConsoleLogger() Logger
func NewFileLogger ¶
func NewFileLogger() Logger
type ZapTeeLogger ¶
func NewZapTeeLogger ¶
func NewZapTeeLogger() *ZapTeeLogger
func (*ZapTeeLogger) AddLogger ¶
func (l *ZapTeeLogger) AddLogger(name string, provider string, config string) error
func (*ZapTeeLogger) Build ¶
func (l *ZapTeeLogger) Build(config string) error
func (*ZapTeeLogger) Close ¶
func (l *ZapTeeLogger) Close() error
func (*ZapTeeLogger) Sync ¶
func (l *ZapTeeLogger) Sync() error
Click to show internal directories.
Click to hide internal directories.