Documentation ¶
Index ¶
- func JsonRawLog(msg, level string, err error)
- func NewLogrus(cfg loggerconfig.Configurator, output Outputer) (logger *Logrus, cancel CancelFunc, err error)
- type CancelFunc
- type Fields
- type Logger
- type Logrus
- func (l *Logrus) Debug(ctx context.Context, err error, fields Fields) error
- func (l *Logrus) DebugMsg(ctx context.Context, msg string, fields Fields)
- func (l *Logrus) Error(ctx context.Context, err error, fields Fields) error
- func (l *Logrus) ErrorMsg(ctx context.Context, msg string, fields Fields)
- func (l *Logrus) Fatal(ctx context.Context, err error, fields Fields) error
- func (l *Logrus) FatalMsg(ctx context.Context, msg string, fields Fields)
- func (l *Logrus) Info(ctx context.Context, err error, fields Fields) error
- func (l *Logrus) InfoMsg(ctx context.Context, msg string, fields Fields)
- func (l *Logrus) Log(ctx context.Context, err error, level string, fields Fields)
- func (l *Logrus) LogMsg(ctx context.Context, msg, level string, fields Fields)
- func (l *Logrus) Panic(ctx context.Context, err error, fields Fields) error
- func (l *Logrus) PanicMsg(ctx context.Context, msg string, fields Fields)
- func (l *Logrus) Warning(ctx context.Context, err error, fields Fields) error
- func (l *Logrus) WarningMsg(ctx context.Context, msg string, fields Fields)
- type Outputer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JsonRawLog ¶ added in v0.0.6
func NewLogrus ¶ added in v0.0.2
func NewLogrus(cfg loggerconfig.Configurator, output Outputer) (logger *Logrus, cancel CancelFunc, err error)
NewLogrus creates a new Logrus logger instance for the given output.
Types ¶
type CancelFunc ¶
type CancelFunc = func()
func NewOutput ¶ added in v0.0.2
func NewOutput(cfg loggerconfig.Configurator) (out *os.File, cancel CancelFunc, err error)
NewOutput opens the target output file and provides cancelFunc for close it. If the output is passed as empty string, then the output will be used from config. NOTE: Must be called just once per unique output, or you will see the error while closing an output that a file already closed. This happens due to two outputs refers to the same file pointer.
type Logger ¶
type Logger interface { DebugMsg(ctx context.Context, msg string, fields Fields) InfoMsg(ctx context.Context, msg string, fields Fields) WarningMsg(ctx context.Context, msg string, fields Fields) ErrorMsg(ctx context.Context, msg string, fields Fields) FatalMsg(ctx context.Context, msg string, fields Fields) PanicMsg(ctx context.Context, msg string, fields Fields) LogMsg(ctx context.Context, msg, level string, fields Fields) Debug(ctx context.Context, err error, fields Fields) error Info(ctx context.Context, err error, fields Fields) error Warning(ctx context.Context, err error, fields Fields) error Error(ctx context.Context, err error, fields Fields) error Fatal(ctx context.Context, err error, fields Fields) error Panic(ctx context.Context, err error, fields Fields) error Log(ctx context.Context, err error, level string, fields Fields) }
type Logrus ¶ added in v0.0.2
type Logrus struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.