log

package
v0.0.0-...-5bb0c7b Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

View Source
const (
	FormatJSON Format = "json"
	FormatText Format = "text"

	LevelDebug Level = "debug"
	LevelInfo  Level = "info"
	LevelWarn  Level = "warn"
	LevelError Level = "error"
	LevelFatal Level = "fatal"
	LevelPanic Level = "panic"
)

Variables

This section is empty.

Functions

func Config

func Config(appName string,
	level Level,
	console bool,
	filename string,
	format LogFormat,
	maxSize int,
	maxBackups int,
	maxAge int)

func Debugf

func Debugf(fmt string, args ...interface{})

func DumpFormattedJson

func DumpFormattedJson(j interface{})

func DumpKeyValue

func DumpKeyValue(j interface{})

func Errorf

func Errorf(fmt string, args ...interface{})

func Fatalf

func Fatalf(fmt string, args ...interface{})

func Flush

func Flush()

func Infof

func Infof(fmt string, args ...interface{})

func Json

func Json(j interface{})

func Messagef

func Messagef(level Level, fmt string, args ...interface{})

func NewNormalCaller

func NewNormalCaller() logrus.Hook

func Panicf

func Panicf(fmt string, args ...interface{})

func Warnf

func Warnf(fmt string, args ...interface{})

Types

type Fields

type Fields map[string]interface{}

type FileLogger

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

func NewFileLogger

func NewFileLogger(filePath string, format LogFormat, maxSize int, maxBackups int, maxAge int) *FileLogger

func (*FileLogger) AppName

func (fileLogger *FileLogger) AppName() string

func (*FileLogger) Debugf

func (fileLogger *FileLogger) Debugf(fmt string, args ...interface{})

func (*FileLogger) Errorf

func (fileLogger *FileLogger) Errorf(fmt string, args ...interface{})

func (*FileLogger) Fatalf

func (fileLogger *FileLogger) Fatalf(fmt string, args ...interface{})

func (*FileLogger) Flush

func (fileLogger *FileLogger) Flush()

func (*FileLogger) Infof

func (fileLogger *FileLogger) Infof(fmt string, args ...interface{})

func (*FileLogger) Messagef

func (fileLogger *FileLogger) Messagef(level Level, fmt string, args ...interface{})

func (*FileLogger) Panicf

func (fileLogger *FileLogger) Panicf(fmt string, args ...interface{})

func (*FileLogger) Warnf

func (fileLogger *FileLogger) Warnf(fmt string, args ...interface{})

func (*FileLogger) With

func (fileLogger *FileLogger) With(fields Fields) *FileLogger

func (*FileLogger) ZapLogger

func (fileLogger *FileLogger) ZapLogger() *zap.Logger

type Format

type Format string

type Level

type Level string

type LogFormat

type LogFormat string
const (
	LogFormatJSON LogFormat = "json"
	LogFormatText LogFormat = "text"
)

type Logger

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

func With

func With(fields Fields) *Logger

func (*Logger) AppName

func (log *Logger) AppName() string

func (*Logger) Debugf

func (log *Logger) Debugf(fmt string, args ...interface{})

func (*Logger) Errorf

func (log *Logger) Errorf(fmt string, args ...interface{})

func (*Logger) Fatalf

func (log *Logger) Fatalf(fmt string, args ...interface{})

func (*Logger) Flush

func (log *Logger) Flush()

func (*Logger) Infof

func (log *Logger) Infof(fmt string, args ...interface{})

func (*Logger) Json

func (log *Logger) Json(j interface{})

func (*Logger) Messagef

func (log *Logger) Messagef(level Level, fmt string, args ...interface{})

func (*Logger) Panicf

func (log *Logger) Panicf(fmt string, args ...interface{})

func (*Logger) Warnf

func (log *Logger) Warnf(fmt string, args ...interface{})

func (*Logger) ZapLogger

func (log *Logger) ZapLogger() *zap.Logger

Jump to

Keyboard shortcuts

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