Documentation ¶
Index ¶
- func ContextWithField(ctx context.Context, key string, value interface{}) context.Context
- func ContextWithFields(ctx context.Context, fields Fields) context.Context
- func NewContextWithLogger(ctx context.Context, logger Logger) context.Context
- type Fields
- type Level
- type LevelRanks
- type Logger
- func ContextAndLoggerWithField(ctx context.Context, key string, value interface{}) (context.Context, Logger)
- func ContextAndLoggerWithFields(ctx context.Context, fields Fields) (context.Context, Logger)
- func LoggerFromContext(ctx context.Context) Logger
- func NewLogger(serializer Serializer, levelRanks LevelRanks, level Level) (Logger, error)
- type Rank
- type Serializer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithField ¶ added in v1.31.0
func ContextWithFields ¶ added in v1.31.0
Types ¶
type Level ¶ added in v1.20.0
type Level string
func DefaultLevel ¶ added in v1.20.0
func DefaultLevel() Level
type LevelRanks ¶ added in v1.20.0
func DefaultLevelRanks ¶ added in v1.20.0
func DefaultLevelRanks() LevelRanks
type Logger ¶
type Logger interface { Log(level Level, message string) Debug(message string) Info(message string) Warn(message string) Error(message string) Debugf(message string, args ...interface{}) Infof(message string, args ...interface{}) Warnf(message string, args ...interface{}) Errorf(message string, args ...interface{}) WithError(err error) Logger WithField(key string, value interface{}) Logger WithFields(fields Fields) Logger WithLevelRank(level Level, rank Rank) Logger WithLevelRanks(levelRanks LevelRanks) Logger WithLevel(level Level) Logger Level() Level }
func ContextAndLoggerWithField ¶ added in v1.31.0
func ContextAndLoggerWithFields ¶ added in v1.31.0
func LoggerFromContext ¶ added in v1.20.0
func NewLogger ¶
func NewLogger(serializer Serializer, levelRanks LevelRanks, level Level) (Logger, error)
type Serializer ¶ added in v1.20.0
Click to show internal directories.
Click to hide internal directories.