Documentation
¶
Overview ¶
logger provides a consistent logging implementation for use across WeMoney back end services
Index ¶
- Constants
- type Level
- type Logger
- func (l *Logger) Ctx(ctx context.Context) *Logger
- func (l *Logger) Debug() *zerolog.Event
- func (l *Logger) DebugWithReqID(ctx context.Context) *zerolog.Event
- func (l *Logger) Error() *zerolog.Event
- func (l *Logger) ErrorWithReqID(ctx context.Context) *zerolog.Event
- func (l *Logger) Fatal() *zerolog.Event
- func (l *Logger) FatalWithReqID(ctx context.Context) *zerolog.Event
- func (l *Logger) Hook(h zerolog.Hook) zerolog.Logger
- func (l *Logger) Info() *zerolog.Event
- func (l *Logger) InfoWithReqID(ctx context.Context) *zerolog.Event
- func (l *Logger) Level(level zerolog.Level) zerolog.Logger
- func (l *Logger) Log() *zerolog.Event
- func (l *Logger) Output(w io.Writer) zerolog.Logger
- func (l *Logger) Panic() *zerolog.Event
- func (l *Logger) PanicWithReqID(ctx context.Context) *zerolog.Event
- func (l *Logger) Print(v ...interface{})
- func (l *Logger) Printf(format string, v ...interface{})
- func (l *Logger) Sample(s zerolog.Sampler) zerolog.Logger
- func (l *Logger) Warn() *zerolog.Event
- func (l *Logger) WarnWithReqID(ctx context.Context) *zerolog.Event
- func (l *Logger) With() zerolog.Context
- func (l *Logger) WithLevel(level zerolog.Level) *zerolog.Event
Constants ¶
const ( DebugLevel = zerolog.DebugLevel InfoLevel = zerolog.InfoLevel WarnLevel = zerolog.WarnLevel ErrorLevel = zerolog.ErrorLevel FatalLevel = zerolog.FatalLevel PanicLevel = zerolog.PanicLevel NoLevel = zerolog.NoLevel Disabled = zerolog.Disabled TraceLevel = zerolog.TraceLevel )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) Ctx ¶
Ctx returns the Logger associated with the ctx. If no logger is associated, a disabled logger is returned.
func (*Logger) Debug ¶
Debug starts a new message with debug level.
You must call Msg on the returned event in order to send the event.
func (*Logger) DebugWithReqID ¶
DebugWithReqID starts a new message with debug level after injecting the reqID to the log
func (*Logger) Error ¶
Error starts a new message with error level.
You must call Msg on the returned event in order to send the event.
func (*Logger) ErrorWithReqID ¶
Error starts a new message with error level after injecting the reqID to the log
func (*Logger) Fatal ¶
Fatal starts a new message with fatal level. The os.Exit(1) function is called by the Msg method.
You must call Msg on the returned event in order to send the event.
func (*Logger) FatalWithReqID ¶
Fatal starts a new message with fatal level after injecting the reqID to the log
func (*Logger) Info ¶
Info starts a new message with info level.
You must call Msg on the returned event in order to send the event.
func (*Logger) InfoWithReqID ¶
InfoWithReqID starts a new message with info level after injecting the reqID to the log
func (*Logger) Log ¶
Log starts a new message with no level. Setting zerolog.GlobalLevel to zerolog.Disabled will still disable events produced by this method.
You must call Msg on the returned event in order to send the event.
func (*Logger) Panic ¶
Panic starts a new message with panic level. The message is also sent to the panic function.
You must call Msg on the returned event in order to send the event.
func (*Logger) PanicWithReqID ¶
Panic starts a new message with panic level after injecting the reqID to the log
func (*Logger) Print ¶
func (l *Logger) Print(v ...interface{})
Print sends a log event using debug level and no extra field. Arguments are handled in the manner of fmt.Print.
func (*Logger) Printf ¶
Printf sends a log event using debug level and no extra field. Arguments are handled in the manner of fmt.Printf.
func (*Logger) Warn ¶
Warn starts a new message with warn level.
You must call Msg on the returned event in order to send the event.
func (*Logger) WarnWithReqID ¶
Warn starts a new message with warn level after injecting the reqID to the log