Documentation
¶
Overview ¶
Package zlogger is a wrapper for zerolog with specific format and optionally integrated with Sentry
Index ¶
- type MultiLevelLogger
- type SimpleLogger
- type ZLogger
- func (z *ZLogger) Debug(v ...interface{})
- func (z *ZLogger) Debugf(format string, v ...interface{})
- func (z *ZLogger) Error(v ...interface{})
- func (z *ZLogger) Errorf(format string, v ...interface{})
- func (z *ZLogger) Fatal(v ...interface{})
- func (z *ZLogger) Fatalf(format string, v ...interface{})
- func (z *ZLogger) GetLogger() zerolog.Logger
- func (z *ZLogger) Info(v ...interface{})
- func (z *ZLogger) Infof(format string, v ...interface{})
- func (z *ZLogger) Panic(v ...interface{})
- func (z *ZLogger) Panicf(format string, v ...interface{})
- func (z *ZLogger) Rotate() error
- func (z *ZLogger) Warn(v ...interface{})
- func (z *ZLogger) Warnf(format string, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultiLevelLogger ¶
type MultiLevelLogger interface {
Printf(format string, args ...interface{})
Print(args ...interface{})
Debug(args ...interface{})
Debugf(format string, args ...interface{})
Info(args ...interface{})
Infof(format string, args ...interface{})
Error(args ...interface{})
Errorf(format string, args ...interface{})
Warn(args ...interface{})
Warnf(format string, args ...interface{})
Fatal(args ...interface{})
Fatalf(format string, args ...interface{})
Panic(args ...interface{})
Panicf(format string, args ...interface{})
}
type SimpleLogger ¶
type SimpleLogger interface {
Printf(format string, args ...interface{})
Print(args ...interface{})
}
type ZLogger ¶
func New ¶
New creates a console zerolog with auto rotating feature
Filename: Filename to write log. If empty, stderr will be used. MaxSize: Max size before rotating, in MB MaxBackups: Number of backups to retain. 0=unlimited color: If true, colors will be used in the output
func NewStdErr ¶
func NewStdErr() *ZLogger
NewStdErr creates a zerolog with stderr output, for testing purposes
func NewWithSentry ¶
func NewWithSentry(filename string, maxSize int, maxBackups int, dsn, release, environment string, color bool) *ZLogger
NewWithSentry creates a zerolog with auto rotating feature and Sentry integration
Filename: Filename to write log. If empty, stderr will be used. MaxSize: Max size before rotating, in MB MaxBackups: Number of backups to retain. 0=unlimited
Click to show internal directories.
Click to hide internal directories.