mlog

package
v0.0.0-...-9078a8e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, fields map[string]interface{})

func Error

func Error(msg string, fields map[string]interface{})

func Fatal

func Fatal(msg string, fields map[string]interface{})

func Info

func Info(msg string, fields map[string]interface{})

func MustSetUp

func MustSetUp(options ...Option)

func SetLogLevel

func SetLogLevel(level string)

func SetLogger

func SetLogger(logger Logger)

func SetOutPutPath

func SetOutPutPath(path string) (err error)

func Warning

func Warning(msg string, fields map[string]interface{})

Types

type ConfigOptions

type ConfigOptions struct {
	OutputPath    string
	MaxFileSizeMB int
	MaxBackups    int
	MaxAges       int
	Compress      bool
	LocalTime     bool
}

func (*ConfigOptions) Logger

func (c *ConfigOptions) Logger() *lumberjack.Logger

type Logger

type Logger interface {
	Debug(msg string, fields map[string]interface{})
	Info(msg string, fields map[string]interface{})
	Warning(msg string, fields map[string]interface{})
	Error(msg string, fields map[string]interface{})
	Fatal(msg string, fields map[string]interface{})
	Level(level string)
	OutputPath(path string) (err error)
}

type Option

type Option func(*ConfigOptions)

func WithCompress

func WithCompress(compress bool) Option

func WithLocalTime

func WithLocalTime(localTime bool) Option

func WithMaxAges

func WithMaxAges(maxAges int) Option

func WithMaxBackups

func WithMaxBackups(maxBackups int) Option

func WithMaxFileSizeMB

func WithMaxFileSizeMB(maxFileSizeMB int) Option

func WithOutPutPath

func WithOutPutPath(outPutPath string) Option

Jump to

Keyboard shortcuts

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