Documentation ¶
Index ¶
- func AddLoggers(l ...Logger)
- func AddStainingUsers(tags ...string)
- func Close()
- func Debugf(ctx context.Context, format string, v ...interface{})
- func DelStainingUsers(tags ...string)
- func Errorf(ctx context.Context, format string, v ...interface{})
- func GetStainingUsers() []string
- func HijackStdlog()
- func Infof(ctx context.Context, format string, v ...interface{})
- func LevelEnabled(lv Level) bool
- func Logf(ctx context.Context, caller *Caller, lv Level, format string, v ...interface{})
- func SetCallerEnable(enable bool)
- func Warnf(ctx context.Context, format string, v ...interface{})
- func WrapWriter(lv Level, tag string) io.Writer
- type Caller
- type Level
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLoggers ¶
func AddLoggers(l ...Logger)
func AddStainingUsers ¶
func AddStainingUsers(tags ...string)
func DelStainingUsers ¶
func DelStainingUsers(tags ...string)
func GetStainingUsers ¶
func GetStainingUsers() []string
func HijackStdlog ¶
func HijackStdlog()
HijackStdlog hijack standard log Hijack standard library log.Print not fmt.Println... example: [2022-11-26 19:08:24][1669460913.111][D] [stdlog]the is example log
func LevelEnabled ¶
func SetCallerEnable ¶
func SetCallerEnable(enable bool)
Types ¶
type Level ¶
type Level int8
Level is a logger Level
func (Level) StringShort ¶
type Logger ¶
type Logger interface { // Log need to format and output: Time Level TraceID Caller Message(format,v...) //! Do not filter level, just log. Log(t time.Time, lv Level, tid string, c *Caller, format string, v ...interface{}) // SetLevel set logger level SetLevel(Level) // GetLevel use by log to filter GetLevel() Level // Close file or other output resource Close() }
Logger is a log record
Click to show internal directories.
Click to hide internal directories.