log

package
v0.0.0-...-fa4cddc Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LogFile    string `json:"logfile"`    // log file name
	LogLevel   string `json:"level"`      // log level
	MaxSize    int    `json:"maxsize"`    // max size of single log file
	MaxBackups int    `json:"maxbackups"` // max logs to retain
	MaxAge     int    `json:"maxage"`     // max days to retain logs
	Compress   bool   `json:"compress"`   // if compress logs
}

type Field

type Field = zap.Field

func Any

func Any(key string, value interface{}) Field

func Array

func Array(key string, val zapcore.ArrayMarshaler) 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 ByteStrings

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

func Duration

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

func Durations

func Durations(key string, ds []time.Duration) Field

func Error

func Error(err error) Field

func Errors

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

func Float32

func Float32(key string, val float32) Field

func Float32s

func Float32s(key string, vals []float32) Field

func Float64

func Float64(key string, val float64) Field

func Float64s

func Float64s(key string, vals []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, vals []int16) Field

func Int32

func Int32(key string, val int32) Field

func Int32s

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

func Int64

func Int64(key string, val int64) Field

func Int64s

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

func Int8

func Int8(key string, val int8) Field

func Int8s

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

func Ints

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

func NamedError

func NamedError(key string, err error) Field

func Namespace

func Namespace(key string) Field

func Object

func Object(key string, val zapcore.ObjectMarshaler) Field

func Stack

func Stack(key string) Field

func String

func String(key string, val string) Field

func Strings

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

func Time

func Time(key string, val time.Time) 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, vals []uint16) Field

func Uint32

func Uint32(key string, val uint32) Field

func Uint32s

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

func Uint64

func Uint64(key string, val uint64) Field

func Uint64s

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

func Uint8

func Uint8(key string, val uint8) Field

func Uint8s

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

func Uints

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

type Logger

type Logger struct {
	*zap.Logger
	zap.AtomicLevel
	// contains filtered or unexported fields
}

func NewAuditLogger

func NewAuditLogger(cfg *Config) *Logger

func NewLogger

func NewLogger(cfg *Config) *Logger

func NewStdLogger

func NewStdLogger(cfg *Config) *Logger

func (*Logger) Close

func (log *Logger) Close() error

func (*Logger) SetStrLevel

func (log *Logger) SetStrLevel(strLevel string)

func (*Logger) With

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

Jump to

Keyboard shortcuts

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