Documentation
¶
Index ¶
- func Debug(ctx context.Context, args ...interface{})
- func DebugKV(ctx context.Context, message string, kvs ...interface{})
- func Debugf(ctx context.Context, format string, args ...interface{})
- func Error(ctx context.Context, args ...interface{})
- func ErrorKV(ctx context.Context, message string, kvs ...interface{})
- func Errorf(ctx context.Context, format string, args ...interface{})
- func Fatal(ctx context.Context, args ...interface{})
- func FatalKV(ctx context.Context, message string, kvs ...interface{})
- func Fatalf(ctx context.Context, format string, args ...interface{})
- func FromContext(ctx context.Context) *zap.SugaredLogger
- func Info(ctx context.Context, args ...interface{})
- func InfoKV(ctx context.Context, message string, kvs ...interface{})
- func Infof(ctx context.Context, format string, args ...interface{})
- func Level() zapcore.Level
- func Logger() *zap.SugaredLogger
- func New(level zapcore.LevelEnabler, options ...zap.Option) *zap.SugaredLogger
- func Panic(ctx context.Context, args ...interface{})
- func PanicKV(ctx context.Context, message string, kvs ...interface{})
- func Panicf(ctx context.Context, format string, args ...interface{})
- func SetLogger(l *zap.SugaredLogger)
- func ToContext(ctx context.Context, l *zap.SugaredLogger) context.Context
- func Warn(ctx context.Context, args ...interface{})
- func WarnKV(ctx context.Context, message string, kvs ...interface{})
- func Warnf(ctx context.Context, format string, args ...interface{})
- func WithFields(ctx context.Context, fields ...zap.Field) context.Context
- func WithKV(ctx context.Context, key string, value interface{}) context.Context
- func WithLevel(lvl zapcore.Level) zap.Option
- func WithName(ctx context.Context, name string) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugKV ¶
DebugKV writes a message and key-value pairs at the debug level using the logger from the context.
func ErrorKV ¶
ErrorKV writes a message and key-value pairs at the error level using the logger from the context.
func Fatal ¶
Fatal writes a fatal error level message using the logger from the context and then calls os.Exit(1).
func FatalKV ¶
FatalKV writes a message and key-value pairs at the fatal error level using the logger from the context and then calls os.Exit(1).
func Fatalf ¶
Fatalf writes a formatted fatal error level message using the logger from the context and then calls os.Exit(1).
func FromContext ¶
func FromContext(ctx context.Context) *zap.SugaredLogger
FromContext достает логгер из контекста. Если в контексте логгер не обнаруживается - возвращает глобальный логгер.
func InfoKV ¶
InfoKV writes a message and key-value pairs at the information level using the logger from the context.
func New ¶
func New(level zapcore.LevelEnabler, options ...zap.Option) *zap.SugaredLogger
New creates a new instance of *zap.SugaredLogger with output in simple console format. If the logging level is not provided, the default level (zap.ErrorLevel) will be used.
func Panic ¶
Panic writes a panic level message using the logger from the context and then calls panic().
func PanicKV ¶
PanicKV writes a message and key-value pairs at the panic level using the logger from the context and then calls panic().
func Panicf ¶
Panicf writes a formatted panic level message using the logger from the context and then calls panic().
func SetLogger ¶
func SetLogger(l *zap.SugaredLogger)
SetLogger sets the global logger. This function is not thread-safe.
func WarnKV ¶
WarnKV writes a message and key-value pairs at the warning level using the logger from the context.
func WithFields ¶
WithFields создает логгер из уже имеющегося в контексте и устанавливает метаданные, используя типизированные поля.
func WithKV ¶
WithKV создает логгер из уже имеющегося в контексте и устанавливает метаданные. Принимает ключ и значение, которые будут наследоваться дочерними логгерами.
Types ¶
This section is empty.