fmlog

package
v0.0.0-...-d20bc16 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugf

func Debugf(msg string, args ...any) bool

func Errorf

func Errorf(msg string, args ...any) bool

func Fatalf

func Fatalf(msg string, args ...any) bool

func Infof

func Infof(msg string, args ...any) bool

func InitDefault

func InitDefault(name string)

func IsDebug

func IsDebug() bool

func IsTrace

func IsTrace() bool

func Panicf

func Panicf(msg string, args ...any) bool

func Tracef

func Tracef(msg string, args ...any) bool

func Warnf

func Warnf(msg string, args ...any) bool

Types

type ConsoleOutputer

type ConsoleOutputer struct {
	Writer     io.Writer
	TimeFormat string
	LevelMap   map[Level]string
}

func NewConsoleOutputer

func NewConsoleOutputer() *ConsoleOutputer

func (*ConsoleOutputer) Output

func (c *ConsoleOutputer) Output(r *Record)

type Facade

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

func (*Facade) DebugFields

func (l *Facade) DebugFields(msg string, fields ...any) bool

func (*Facade) Debugf

func (l *Facade) Debugf(msg string, args ...any) bool

func (*Facade) ErrorFields

func (l *Facade) ErrorFields(msg string, fields ...any) bool

func (*Facade) Errorf

func (l *Facade) Errorf(msg string, args ...any) bool

func (*Facade) FatalFields

func (l *Facade) FatalFields(msg string, fields ...any) bool

func (*Facade) Fatalf

func (l *Facade) Fatalf(msg string, args ...any) bool

func (*Facade) InfoFields

func (l *Facade) InfoFields(msg string, fields ...any) bool

func (*Facade) Infof

func (l *Facade) Infof(msg string, args ...any) bool

func (*Facade) Level

func (l *Facade) Level(level Level) *Record

func (*Facade) PanicFields

func (l *Facade) PanicFields(msg string, fields ...any) bool

func (*Facade) Panicf

func (l *Facade) Panicf(msg string, args ...any) bool

func (*Facade) TraceFields

func (l *Facade) TraceFields(msg string, fields ...any) bool

func (*Facade) Tracef

func (l *Facade) Tracef(msg string, args ...any) bool

func (*Facade) WarnFields

func (l *Facade) WarnFields(msg string, fields ...any) bool

func (*Facade) Warnf

func (l *Facade) Warnf(msg string, args ...any) bool

func (*Facade) WithFields

func (l *Facade) WithFields(fields ...any) *Facade

type GeneralLogger

type GeneralLogger interface {
	Tracef(msg string, args ...any) bool
	Debugf(msg string, args ...any) bool
	Infof(msg string, args ...any) bool
	Warnf(msg string, args ...any) bool
	Errorf(msg string, args ...any) bool
	Fatalf(msg string, args ...any) bool
	Panicf(msg string, args ...any) bool
}

type Level

type Level int
const (
	LevelTrace Level = 10
	LevelDebug Level = 20
	LevelInfo  Level = 30
	LevelWarn  Level = 40
	LevelError Level = 50
	LevelNone  Level = 100
	LevelFatal Level = 110
	LevelPanic Level = 120
)

func (Level) IsSevererOrEqual

func (l Level) IsSevererOrEqual(t Level) bool

func (Level) String

func (l Level) String() string

type Logger

type Logger struct {
	*Facade
	// contains filtered or unexported fields
}
var DefaultLogger *Logger

func (*Logger) AddOutputer

func (l *Logger) AddOutputer(o Outputer)

func (*Logger) GetLevel

func (l *Logger) GetLevel() Level

func (*Logger) IsDebug

func (l *Logger) IsDebug() bool

func (*Logger) IsTrace

func (l *Logger) IsTrace() bool

func (*Logger) SetLevel

func (l *Logger) SetLevel(level Level)

func (*Logger) SetLevelName

func (l *Logger) SetLevelName(levelName string)

func (*Logger) SubLogger

func (l *Logger) SubLogger(name string) *Logger

type Outputer

type Outputer interface {
	Output(r *Record)
}

type Record

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

func (*Record) MsgFields

func (r *Record) MsgFields(msg string, fields ...any) bool

func (*Record) Msgf

func (r *Record) Msgf(msg string, args ...any) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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