log

package
v0.0.0-...-c314f80 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelInfo  = LevelInformational
	LevelTrace = LevelDebug
	LevelWarn  = LevelWarning
)

Legacy log level constants to ensure backwards compatibility.

Variables

This section is empty.

Functions

func Close

func Close()

func Debug

func Debug(s string, fields ...Field)

func Err

func Err(s string, fields ...Field)

func Fatal

func Fatal(s string, fields ...Field)

func Info

func Info(s string, fields ...Field)

func Init

func Init(path string, level Level, encodingJson bool, callerSkip ...int) error

func NewEncoding

func NewEncoding(encoding Encoding) string

func NewLogLevel

func NewLogLevel(level Level) zap.AtomicLevel

NewLogLevel is a convenience function that creates an AtomicLevel

func Warn

func Warn(s string, fields ...Field)

Types

type Encoding

type Encoding uint8
const (
	EncodingEmergency Encoding = iota
	EncodingConsole
	EncodingJson
)

type Field

type Field = zap.Field

func Binary

func Binary(key string, val []byte) Field

func Bool

func Bool(key string, val bool) Field

func Bools

func Bools(key string, bs []bool) Field

func ByteString

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

func Error

func Error(key string, val error) Field

func Errors

func Errors(key string, val []error) Field

func Float32

func Float32(key string, val float32) Field

func Float64

func Float64(key string, val float64) Field

func Int

func Int(key string, val int) Field

func Int16

func Int16(key string, val int16) Field

func Int16s

func Int16s(key string, nums []int16) Field

func Int32

func Int32(key string, val int32) Field

func Int32s

func Int32s(key string, nums []int32) Field

func Int64

func Int64(key string, val int64) Field

func Int64s

func Int64s(key string, nums []int64) Field

func Int8

func Int8(key string, val int8) Field

func Int8s

func Int8s(key string, nums []int8) Field

func Ints

func Ints(key string, nums []int) Field

func String

func String(key string, val string) Field

func Strings

func Strings(key string, ss []string) Field

func Times

func Times(key string, ts []time.Time) Field

func Uint

func Uint(key string, val uint) Field

func Uint16

func Uint16(key string, val uint16) Field

func Uint16s

func Uint16s(key string, nums []uint16) Field

func Uint32

func Uint32(key string, val uint32) Field

func Uint32s

func Uint32s(key string, nums []uint32) Field

func Uint64

func Uint64(key string, val uint64) Field

func Uint64s

func Uint64s(key string, nums []uint64) Field

func Uint8

func Uint8(key string, val uint8) Field

func Uint8s

func Uint8s(key string, nums []uint8) Field

func Uints

func Uints(key string, nums []uint) Field

type Level

type Level uint8
const (
	LevelEmergency Level = iota
	LevelError
	LevelWarning
	LevelInformational
	LevelDebug
)

type Logger

type Logger struct {
	// contains filtered or unexported fields
}
var DefaultLogger *Logger

func NewLogger

func NewLogger(encoding Encoding, path string, level Level, callerSkip int) (*Logger, error)

func (*Logger) CloneWithCallerSkip

func (l *Logger) CloneWithCallerSkip(callerSkip int) *Logger

func (*Logger) Close

func (l *Logger) Close()

func (*Logger) Debug

func (l *Logger) Debug(s string, fields ...Field)

func (*Logger) Err

func (l *Logger) Err(s string, fields ...Field)

func (*Logger) Fatal

func (l *Logger) Fatal(s string, fields ...Field)

func (*Logger) Info

func (l *Logger) Info(s string, fields ...Field)

func (*Logger) Warn

func (l *Logger) Warn(s string, fields ...Field)

Jump to

Keyboard shortcuts

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