log

package
v0.0.0-...-60f2cf5 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

log defines a logging intefrace and wraps uber-go/zap logger

log defines a logging intefrace and wraps uber-go/zap logger

Index

Constants

View Source
const (
	// PanicLevel logs message and then calls `panic“
	PanicLevel = zap.PanicLevel
	// FatalLevel logs and then calls `os.Exit(1)`. It will exit even if the
	// logging level is set to Panic.
	FatalLevel = zap.FatalLevel
	// ErrorLevel should be used for any error
	ErrorLevel = zap.ErrorLevel
	// WarnLevel to be used on non-erroneous cases that could however be undesired
	WarnLevel = zap.WarnLevel
	// InfoLevel to be used for output directed at the user
	InfoLevel = zap.InfoLevel
	// DebugLevel to only be enabled when debugging
	DebugLevel = zap.DebugLevel
)

Variables

This section is empty.

Functions

func Any

func Any(key string, val interface{}) zap.Field

func Bool

func Bool(key string, val bool) zap.Field

func ByteString

func ByteString(key string, val []byte) zap.Field

func Debug

func Debug(msg string, i ...zap.Field)

func Duration

func Duration(key string, val time.Duration) zap.Field

func Err

func Err(val error) zap.Field

func Error

func Error(msg string, i ...zap.Field)

func Fatal

func Fatal(msg string, i ...zap.Field)

func Info

func Info(msg string, i ...zap.Field)

func Int

func Int(key string, val int) zap.Field

func Int64

func Int64(key string, val int64) zap.Field

func IsConsole

func IsConsole() bool

func IsJson

func IsJson() bool

func Log

func Log(level zapcore.Level, msg string, i ...zap.Field)

func Print

func Print(msg string, i ...zap.Field)

func String

func String(key string, val string) zap.Field

func Strings

func Strings(key string, val []string) zap.Field

func Time

func Time(key string, val time.Time) zap.Field

func Warn

func Warn(msg string, i ...zap.Field)

Types

type Field

type Field = zap.Field

type Level

type Level = zapcore.Level

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger() *Logger

func With

func With(fields ...zap.Field) *Logger

func (*Logger) Debug

func (l *Logger) Debug(msg string, i ...zap.Field)

func (*Logger) Error

func (l *Logger) Error(msg string, i ...zap.Field)

func (*Logger) Fatal

func (l *Logger) Fatal(msg string, i ...zap.Field)

func (*Logger) Info

func (l *Logger) Info(msg string, i ...zap.Field)

func (*Logger) Log

func (l *Logger) Log(level zapcore.Level, msg string, i ...zap.Field)

func (*Logger) Print

func (l *Logger) Print(msg string, i ...zap.Field)

func (*Logger) SetLevel

func (l *Logger) SetLevel(level zapcore.Level)

func (*Logger) Warn

func (l *Logger) Warn(msg string, i ...zap.Field)

func (*Logger) With

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

func (*Logger) WithOptions

func (l *Logger) WithOptions(opts ...zap.Option) *Logger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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