Documentation
¶
Index ¶
- func ContextWithLogger(ctx context.Context, l Logger) context.Context
- func Debug(ctx context.Context, msg string)
- func Error(ctx context.Context, msg string)
- func Fatal(ctx context.Context, msg string)
- func Info(ctx context.Context, msg string)
- func Init(ctx context.Context, p Params)
- func Warn(ctx context.Context, msg string)
- type Fields
- type Logger
- type Params
- type SentryParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithLogger ¶
ContextWithLogger adds Logger to context and returns new context.
func Debug ¶
Debug prints debug-level log message. Usually very verbose and shown only when debug level is enabled.
Types ¶
type Logger ¶
type Logger interface {
Debug(msg string)
Info(msg string)
Warn(msg string)
Error(msg string)
Fatal(msg string)
WithError(err error) Logger
WithField(key string, value interface{}) Logger
WithFields(fields Fields) Logger
Writer() io.WriteCloser
}
Logger serves as an adapter interface for logger libraries so that we not depend on any of them directly.
func FromContext ¶
FromContext extracts Logger from context. If no instance found - returns Logger from default logInstance.
type Params ¶
type Params struct {
Level string
Format string
SentryParams SentryParams
}
Params holds logger specific params.
Click to show internal directories.
Click to hide internal directories.