log

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string)

Debug ...

func Error

func Error(msg string)

Error ...

func Info

func Info(msg string)

Info ...

func Init

func Init(level LogLevel, optionList ...RotationOption)

Init 简单初始化系统日志,只需要制定日志保存路径

func Logger added in v0.0.6

func Logger() *log.Logger

func Trace

func Trace(msg string)

Trace ...

func Warning

func Warning(msg string)

Warning ...

Types

type LogLevel

type LogLevel int

LogLevel 0:trace; 10:debug; 20:info; 30:warning; 40:error;

const (
	TraceLevel LogLevel = iota * 10
	DebugLevel
	InfoLevel
	WarningLevel
	ErrorLevel
)

type RotationOption

type RotationOption func(*RotationSetting)

func WithLogPath

func WithLogPath(logPath string) RotationOption

func WithMaxAge

func WithMaxAge(maxAge time.Duration) RotationOption

func WithNameFormat

func WithNameFormat(nameFormat string) RotationOption

func WithRotationSize

func WithRotationSize(rotationSize int64) RotationOption

func WithRotationTime

func WithRotationTime(rotationTime time.Duration) RotationOption

type RotationSetting

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

Jump to

Keyboard shortcuts

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