Documentation
¶
Index ¶
- Constants
- func Alert(f any, v ...any)
- func Debug(f any, v ...any)
- func Error(f any, v ...any)
- func Fatal(f any, v ...any)
- func Panic(f any, v ...any)
- func SetCallDepth(depth int)
- func SetLevel(level Level)
- func SetOutput(name string, output Output) error
- func SetPathTrim(trimPath string)
- func Sprintf(format any, args ...any) (text string)
- func Trace(f any, v ...any)
- type Conn
- type Console
- type File
- type Interface
- type Level
- type Logger
- func (this *Logger) Alert(format interface{}, args ...interface{})
- func (this *Logger) Debug(format interface{}, v ...interface{})
- func (this *Logger) DelOutput(name string)
- func (this *Logger) Error(format interface{}, v ...interface{})
- func (this *Logger) Fatal(format any, args ...any)
- func (this *Logger) Panic(format any, args ...any)
- func (this *Logger) SetCallDepth(depth int)
- func (this *Logger) SetLevel(level Level)
- func (this *Logger) SetOutput(name string, output Output) error
- func (this *Logger) SetPathTrim(trimPath string)
- func (this *Logger) Trace(format interface{}, v ...interface{})
- func (this *Logger) Write(msg *Message)
- type Message
- type Output
Constants ¶
View Source
const ( LevelDebug Level = 0 // 用户级调试 LevelTrace = 1 // 用户级基本输出 LevelAlert = 2 LevelError = 7 // 用户级错误 LevelPanic = 8 //Panic LevelFATAL = 9 //PANIC )
日志等级,从0-7,日优先级由高到低
View Source
const DefaultConsoleName = "_defaultConsoleName"
Variables ¶
This section is empty.
Functions ¶
func SetCallDepth ¶ added in v0.0.2
func SetCallDepth(depth int)
Types ¶
type Conn ¶ added in v0.0.2
type Console ¶ added in v0.0.2
type Console struct {
sync.Mutex
Sprintf func(*Message) string
// contains filtered or unexported fields
}
func NewConsole ¶ added in v0.0.2
func NewConsole() *Console
type File ¶ added in v0.0.2
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) Debug ¶
func (this *Logger) Debug(format interface{}, v ...interface{})
Debug Log DEBUG level message.
func (*Logger) Error ¶
func (this *Logger) Error(format interface{}, v ...interface{})
Error Log ERROR level message.
func (*Logger) SetCallDepth ¶
func (*Logger) SetPathTrim ¶ added in v0.0.2
SetPathTrim 设置日志起始路径
Click to show internal directories.
Click to hide internal directories.