log

package
v1.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AfterError spi.AfterError
)

Functions

func Debug

func Debug(format string, a ...interface{})

func Error

func Error(format string, a ...interface{})

func Fatal

func Fatal(format string, a ...interface{})

func Info

func Info(format string, a ...interface{})

func InitDefaultLogger

func InitDefaultLogger()

func IsDebugLevel added in v1.2.0

func IsDebugLevel() bool

func Panic

func Panic(format string, a ...interface{})

func Warn

func Warn(format string, a ...interface{})

Types

type Logger

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

func NewLogger

func NewLogger(config *LoggerConfig) *Logger

func (*Logger) Debug

func (logger *Logger) Debug(format string, a ...interface{})

func (*Logger) Error

func (logger *Logger) Error(format string, a ...interface{})

func (*Logger) Fatal

func (logger *Logger) Fatal(format string, a ...interface{})

func (*Logger) GetLevel added in v1.2.0

func (logger *Logger) GetLevel() string

func (*Logger) Info

func (logger *Logger) Info(format string, a ...interface{})

func (*Logger) Panic

func (logger *Logger) Panic(format string, a ...interface{})

func (*Logger) RawJson

func (logger *Logger) RawJson(key string, raw []byte, format string, a ...interface{})

func (*Logger) Warn

func (logger *Logger) Warn(format string, a ...interface{})

type LoggerConfig

type LoggerConfig struct {
	Level           string `yaml:"level,omitempty"`
	JsonFormat      bool   `yaml:"jsonFormat,omitempty"`
	EnableStdout    bool   `yaml:"enableStdout,omitempty"`
	EnableFile      bool   `yaml:"enableFile,omitempty"`
	Directory       string `yaml:"directory,omitempty"`
	Filename        string `yaml:"filename,omitempty"`
	MaxSize         int    `yaml:"maxSize,omitempty"`
	MaxBackups      int    `yaml:"maxBackups,omitempty"`
	MaxAge          int    `yaml:"maxAge,omitempty"`
	TimeFormat      string `yaml:"timeFormat,omitempty"`
	CallerSkipCount int    `yaml:"callerSkipCount,omitempty"`
	NoColor         bool   `yaml:"noColor,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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