logger

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugf

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

func Errorf

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

func Infof

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

func SetLogLevel

func SetLogLevel(level string)

func SetLogger

func SetLogger(logger Logger)

SetLogger use specified logger user customized, in general, we suggest user to replace the default logger with specified

func SetOutputPath

func SetOutputPath(path string) (err error)

func Warnf

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

Types

type Config

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

func (*Config) Logger

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

type Logger

type Logger interface {
	Debugf(msg string, args ...interface{})
	Infof(msg string, args ...interface{})
	Warnf(msg string, args ...interface{})
	Errorf(msg string, args ...interface{})
	Level(level string)
	OutputPath(path string) (err error)
}

Jump to

Keyboard shortcuts

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