logger

package
v0.0.0-...-0e64a8c Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DDMMYYYYhhmmss = "20060102150405"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel int
const (
	LogLevelFatal LogLevel = iota
	LogLevelPanic
	LogLevelError
	LogLevelWarn
	LogLevelInfo
	LogLevelDebug
	LogLevelTrace
)

func (LogLevel) String

func (level LogLevel) String() string

type Logger

type Logger interface {
	NewLogger(logName string, logLevel ...LogLevel) (Logger, error)
	DeleteLogger() error
	SetLogLevel(logLevel LogLevel) error
	Fatal(err error, intf ...interface{})
	Panic(err error, intf ...interface{})
	Error(err error, intf ...interface{})
	Warn(err error, intf ...interface{})
	Info(err error, intf ...interface{})
	Debug(err error, intf ...interface{})
	Trace(err error, intf ...interface{})
}

type ModLogger

type ModLogger struct {
	FatalLog   *log.Logger
	PanicLog   *log.Logger
	ErrorLog   *log.Logger
	WarnLog    *log.Logger
	InfoLog    *log.Logger
	DebugLog   *log.Logger
	TraceLog   *log.Logger
	LogFile    *os.File
	CreateTime time.Time
	LogMutex   sync.Mutex
	RefCount   int
}

func NewLogger

func NewLogger(logName string, logLevel ...LogLevel) (*ModLogger, error)

func (*ModLogger) Close

func (l *ModLogger) Close() error

func (*ModLogger) Debug

func (l *ModLogger) Debug(err error, intf ...interface{})

func (*ModLogger) Error

func (l *ModLogger) Error(err error, intf ...interface{})

func (*ModLogger) Fatal

func (l *ModLogger) Fatal(err error, intf ...interface{})

func (*ModLogger) Info

func (l *ModLogger) Info(err error, intf ...interface{})

func (*ModLogger) Panic

func (l *ModLogger) Panic(err error, intf ...interface{})

func (*ModLogger) SetLogLevel

func (l *ModLogger) SetLogLevel(logLevel LogLevel) error

func (*ModLogger) Trace

func (l *ModLogger) Trace(err error, intf ...interface{})

func (*ModLogger) Warn

func (l *ModLogger) Warn(err error, intf ...interface{})

Jump to

Keyboard shortcuts

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