Documentation ¶
Overview ¶
logutil包提供一个日志对象 日志对象提供一下功能:
1、提供 Panic Fatal Error Warn Info Debug Trace 七个日志级别,以及动态设置 2、支持指定日志路径与日志文件名 3、支持动态设置tag过滤
Index ¶
- Constants
- func GetCaller(skip int) string
- func GetCallerStack(skip int) string
- func Printf(v any, alignment bool) string
- type Frame
- type Logger
- func (l *Logger) AddHook_FileLog(logPath, logName string)
- func (l *Logger) AddHook_LogService(callback port.LogServiceCallBack)
- func (l *Logger) AddTagFilter(tag string)
- func (l *Logger) Debugf(tag, format string, args ...any)
- func (l *Logger) Debugf_Skip(skip int, tag, format string, args ...any)
- func (l *Logger) DelTagFilter(tag string)
- func (l *Logger) Errorf(tag, format string, args ...any)
- func (l *Logger) Errorf_Skip(skip int, tag, format string, args ...any)
- func (l *Logger) Fatalf(tag, format string, args ...any)
- func (l *Logger) Fatalf_Skip(skip int, tag, format string, args ...any)
- func (l *Logger) Infof(tag, format string, args ...any)
- func (l *Logger) Infof_Skip(skip int, tag, format string, args ...any)
- func (l *Logger) Panicf(tag, format string, args ...any)
- func (l *Logger) Panicf_Skip(skip int, tag, format string, args ...any)
- func (l *Logger) ResetFilter()
- func (l *Logger) SetLevel(level string) error
- func (l *Logger) Tracef(tag, format string, args ...any)
- func (l *Logger) Tracef_Skip(skip int, tag, format string, args ...any)
- func (l *Logger) Wait()
- func (l *Logger) Warnf(tag, format string, args ...any)
- func (l *Logger) Warnf_Skip(skip int, tag, format string, args ...any)
- type MyPrintf
- type Stack
Constants ¶
View Source
const (
Value_Nil = "<nil>"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Frame ¶
type Frame uintptr
Frame represents a program counter inside a stack frame. For historical reasons if Frame is interpreted as a uintptr its value represents the program counter + 1.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
日志对象
func (*Logger) AddHook_FileLog ¶
将日志输出到指定文件
func (*Logger) AddHook_LogService ¶
func (l *Logger) AddHook_LogService(callback port.LogServiceCallBack)
将日志输出到指定服务
func (*Logger) Debugf_Skip ¶
Debug log, but can specify caller skip
func (*Logger) Errorf_Skip ¶
Error log, but can specify caller skip
func (*Logger) Fatalf_Skip ¶
Fatal log, but can specify caller skip
func (*Logger) Infof_Skip ¶
Info log, but can specify caller skip
func (*Logger) Panicf_Skip ¶
Panic log, but can specify caller skip
func (*Logger) Tracef_Skip ¶
Trace log, but can specify caller skip
Click to show internal directories.
Click to hide internal directories.