builtinlog

package module
v0.0.0-...-eee45d0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	*log.Logger
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(options ...Option) *Logger

func (*Logger) Debug

func (l *Logger) Debug(args ...any)

func (*Logger) Debugf

func (l *Logger) Debugf(format string, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(args ...any)

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...interface{})

func (*Logger) Fatal

func (l *Logger) Fatal(args ...any)

Fatal is equivalent to l.Print() followed by a call to os.Exit(1).

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, args ...any)

Fatalf is equivalent to l.Printf() followed by a call to os.Exit(1).

func (*Logger) Info

func (l *Logger) Info(args ...any)

func (*Logger) Infof

func (l *Logger) Infof(format string, args ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(args ...any)

func (*Logger) Warnf

func (l *Logger) Warnf(format string, args ...interface{})

type Option

type Option func(g *option)

func WithCallDepth

func WithCallDepth(depth int) Option

func WithMaxFileSize

func WithMaxFileSize(size int) Option

单个日志文件大小(单位:MB)

func WithMaxSaveDuration

func WithMaxSaveDuration(day int) Option

文件最多保留多长时间(单位:Day)

func WithSyncConsole

func WithSyncConsole() Option

func WithSyncFile

func WithSyncFile(file string) Option

func WithTimeFormat

func WithTimeFormat(format string) Option

时间格式

Jump to

Keyboard shortcuts

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