Documentation
¶
Index ¶
- Constants
- type LogAdapter
- func (l *LogAdapter) Debugf(format string, args ...any)
- func (l *LogAdapter) Errorf(format string, args ...any)
- func (l *LogAdapter) Infof(format string, args ...any)
- func (l *LogAdapter) SetLogLevel(level int)
- func (l *LogAdapter) SetLogger(logger *log.Logger)
- func (l *LogAdapter) Warningf(format string, args ...any)
- type Logger
Constants ¶
View Source
const ( DebugLevel = iota InfoLevel WarningLevel ErrorLevel )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogAdapter ¶
type LogAdapter struct {
// contains filtered or unexported fields
}
LogAdapter 是一个适配器,适配 Go 标准库的 log 包
func NewLogAdapter ¶
func NewLogAdapter(out io.Writer, level int) *LogAdapter
NewLogAdapter 创建一个 LogAdapter 实例
func (*LogAdapter) Debugf ¶
func (l *LogAdapter) Debugf(format string, args ...any)
Debugf 打印 debug 级别日志
func (*LogAdapter) Infof ¶
func (l *LogAdapter) Infof(format string, args ...any)
Infof 打印 info 级别日志
func (*LogAdapter) SetLogLevel ¶
func (l *LogAdapter) SetLogLevel(level int)
func (*LogAdapter) SetLogger ¶
func (l *LogAdapter) SetLogger(logger *log.Logger)
func (*LogAdapter) Warningf ¶
func (l *LogAdapter) Warningf(format string, args ...any)
Warningf 打印警告级别日志
Click to show internal directories.
Click to hide internal directories.