Documentation ¶
Index ¶
- func Blue(buffer *bytes.Buffer, content string, closeStr bool)
- func CountFileNum(path string, prefix string) (int, error)
- func Cyan(buffer *bytes.Buffer, content string, closeStr bool)
- func Green(buffer *bytes.Buffer, content string, closeStr bool)
- func Magenta(buffer *bytes.Buffer, content string, closeStr bool)
- func NotColor(buffer *bytes.Buffer, content string, closeStr bool)
- func PrintLogger(level LogLevel, format string, args ...any)
- func Red(buffer *bytes.Buffer, content string, closeStr bool)
- func White(buffer *bytes.Buffer, content string, closeStr bool)
- func Yellow(buffer *bytes.Buffer, content string, closeStr bool)
- type ColorLevel
- type ILogger
- type LogEntry
- type LogFile
- type LogLevel
- type ToolLogger
- func (l *ToolLogger) Color(color ColorLevel, format string, args ...any) string
- func (l *ToolLogger) Debug(format string, args ...any)
- func (l *ToolLogger) Error(format string, args ...any)
- func (l *ToolLogger) Fail(format string, args ...any)
- func (l *ToolLogger) GetPrefix() string
- func (l *ToolLogger) Info(format string, args ...any)
- func (l *ToolLogger) PrintLogger(level LogLevel, format string, args ...any)
- func (l *ToolLogger) Warn(format string, args ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintLogger ¶
Types ¶
type ColorLevel ¶ added in v1.0.1
type ColorLevel int
type ILogger ¶
type ILogger interface { GetPrefix() string // 获取前缀 PrintLogger(LogLevel, string, ...any) // 输出日志 Info(string, ...any) // Debug(string, ...any) // Warn(string, ...any) // 警告 Fail(string, ...any) // 失败 Error(string, ...any) // 错误 Color(ColorLevel, string, ...any) string }
ILogger 日志抽象方法
type LogEntry ¶
type ToolLogger ¶
type ToolLogger struct { Prefix string // 日志前缀 TimeFormat string // 时间格式 // contains filtered or unexported fields }
func Default ¶
func Default(prefix ...string) *ToolLogger
func DefaultLogger ¶
func DefaultLogger(logFile string) *ToolLogger
func (*ToolLogger) Color ¶ added in v1.0.1
func (l *ToolLogger) Color(color ColorLevel, format string, args ...any) string
func (*ToolLogger) Debug ¶
func (l *ToolLogger) Debug(format string, args ...any)
func (*ToolLogger) Error ¶
func (l *ToolLogger) Error(format string, args ...any)
func (*ToolLogger) Fail ¶
func (l *ToolLogger) Fail(format string, args ...any)
func (*ToolLogger) GetPrefix ¶
func (l *ToolLogger) GetPrefix() string
func (*ToolLogger) Info ¶
func (l *ToolLogger) Info(format string, args ...any)
func (*ToolLogger) PrintLogger ¶
func (l *ToolLogger) PrintLogger(level LogLevel, format string, args ...any)
func (*ToolLogger) Warn ¶
func (l *ToolLogger) Warn(format string, args ...any)
Click to show internal directories.
Click to hide internal directories.