Documentation
¶
Index ¶
- Constants
- Variables
- func Debug(a ...any)
- func Debugf(format string, a ...any)
- func DumpJson()
- func Error(a ...any)
- func Errorf(format string, a ...any)
- func Fatal(a ...any)
- func Fatalf(format string, a ...any)
- func Info(a ...any)
- func Infof(format string, a ...any)
- func Panic(a ...any)
- func Panicf(format string, a ...any)
- func SetFormat(format string)
- func SetFullPath(fullPath bool)
- func SetLevel(level LogLevel)
- func SetMsgMinLen(mlen int)
- func SetTimeFormat(format string)
- func Sprintf(format string, h map[string]any) string
- func Trace(a ...any)
- func Tracef(format string, a ...any)
- func Warn(a ...any)
- func Warnf(format string, a ...any)
- type Config
- type Entry
- func (e *Entry) Debug(a ...any)
- func (e *Entry) Debugf(format string, a ...any)
- func (e *Entry) Error(a ...any)
- func (e *Entry) Errorf(format string, a ...any)
- func (e *Entry) Fatal(a ...any)
- func (e *Entry) Fatalf(format string, a ...any)
- func (e *Entry) Info(a ...any)
- func (e *Entry) Infof(format string, a ...any)
- func (e *Entry) Panic(a ...any)
- func (e *Entry) Panicf(format string, a ...any)
- func (e *Entry) Trace(a ...any)
- func (e *Entry) Tracef(format string, a ...any)
- func (e *Entry) Warn(a ...any)
- func (e *Entry) Warnf(format string, a ...any)
- func (e *Entry) With(fields Fields) *Entry
- type Fields
- type H
- type Interface
- type LogLevel
- type MutexWrap
Constants ¶
View Source
const ( Reset = "\033[0m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Magenta = "\033[35m" Cyan = "\033[36m" White = "\033[37m" GreenBold = "\033[32;1m" BlueBold = "\033[34;1m" MagentaBold = "\033[35;1m" RedBold = "\033[31;1m" YellowBold = "\033[33;1m" )
Variables ¶
View Source
var ( DefaultFormat = "${time} ${level} ${path} ${msg}" DefaultTimeFormat = "2006/01/02 15:04:05" )
Functions ¶
func SetFullPath ¶
func SetFullPath(fullPath bool)
func SetMsgMinLen ¶
func SetMsgMinLen(mlen int)
func SetTimeFormat ¶
func SetTimeFormat(format string)
Types ¶
type Config ¶
type Config struct {
Json bool
Format string
TimeFormat string
LogLevel LogLevel
FullPath bool
MsgMinLen int
}
Config logger config
type Interface ¶
type Interface interface {
DumpJson()
SetConfig(cfg Config)
SetLevel(LogLevel)
SetFormat(string)
SetTimeFormat(string)
SetFullPath(bool)
SetMsgMinLen(mlen int)
Is(bool) *Entry
With(fields Fields) *Entry
Trace(a ...any)
Tracef(format string, a ...any)
Debug(a ...any)
Debugf(format string, a ...any)
Info(a ...any)
Infof(format string, a ...any)
Warn(a ...any)
Warnf(format string, a ...any)
Error(a ...any)
Errorf(format string, a ...any)
Fatal(a ...any)
Fatalf(format string, a ...any)
Panic(a ...any)
Panicf(format string, a ...any)
}
func DefaultInstance ¶
func DefaultInstance() Interface
Click to show internal directories.
Click to hide internal directories.