logkit

package
v0.0.0-...-fe7ef4e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithContext

func WithContext(ctx context.Context, logger *Logger) context.Context

Types

type Logger

type Logger struct {
	*zap.Logger
}

func FromContext

func FromContext(ctx context.Context) *Logger

func NewLogger

func NewLogger(conf *LoggerConfig) *Logger

func NewNopLogger

func NewNopLogger() *Logger

func (*Logger) With

func (l *Logger) With(fields ...zapcore.Field) *Logger

func (*Logger) WithContext

func (l *Logger) WithContext(ctx context.Context) context.Context

type LoggerConfig

type LoggerConfig struct {
	Level       LoggerLevel `long:"level" description:"set log level" default:"info" env:"LEVEL"`
	Development bool        `long:"development" description:"enable development mode" env:"DEVELOPMENT"`
}

type LoggerLevel

type LoggerLevel zapcore.Level

func (LoggerLevel) MarshalFlag

func (l LoggerLevel) MarshalFlag() (string, error)

func (*LoggerLevel) UnmarshalFlag

func (l *LoggerLevel) UnmarshalFlag(value string) error

type SaramaLogger

type SaramaLogger struct {
	*Logger
}

SaramaLogger implements saramakit.Logger

func NewSaramaLogger

func NewSaramaLogger(logger *Logger) *SaramaLogger

func (*SaramaLogger) Error

func (l *SaramaLogger) Error(msg string, err error)

func (*SaramaLogger) With

func (l *SaramaLogger) With(key, value string) saramakit.Logger

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL