Documentation
¶
Overview ¶
* @Description: * @Author: linzhengmao * @Email: [email protected] * @Date: 2025-09-26 14:33:33 * @LastEditTime: 2026-01-08 12:07:53 * @LastEditors: linzhengmao
* @Description: * @Author: linzhengmao * @Email: [email protected] * @Date: 2025-09-26 22:43:01 * @LastEditTime: 2026-01-08 14:29:04 * @LastEditors: linzhengmao
* @Description: * @Author: linzhengmao * @Email: [email protected] * @Date: 2025-09-26 14:33:38 * @LastEditTime: 2026-01-08 14:29:56 * @LastEditors: linzhengmao
* @Description: * @Author: linzhengmao * @Email: [email protected] * @Date: 2025-09-26 14:40:47 * @LastEditTime: 2026-01-08 12:28:15 * @LastEditors: linzhengmao
Index ¶
- Constants
- func Close()
- func Debug(msg string, args ...interface{})
- func Debugf(format string, args ...interface{})
- func DebugfCallerSkip(skip int, format string, args ...interface{})
- func Error(msg string, args ...interface{})
- func ErrorE(err error)
- func ErrorECallerSkip(skip int, err error)
- func Errorf(format string, args ...interface{})
- func ErrorfCallerSkip(skip int, format string, args ...interface{})
- func Fatal(msg string, args ...interface{})
- func Fatalf(format string, args ...interface{})
- func FatalfCallerSkip(skip int, format string, args ...interface{})
- func GetColorMessage(color ColorType, format string, args ...interface{}) string
- func HexDump(data []byte, length int) string
- func HexDumpCustom(data []byte, length int, lineSize int) string
- func Info(msg string, args ...interface{})
- func Infof(format string, args ...interface{})
- func InfofCallerSkip(skip int, format string, args ...interface{})
- func PrintInstances()
- func Raw(color ColorType, message string, args ...interface{})
- func RawWithInfo(color ColorType, title string, format string, args ...interface{})
- func Rawln(color ColorType, message string, args ...interface{})
- func Setup(config *Config) error
- func Trace(msg string, args ...interface{})
- func Tracef(format string, args ...interface{})
- func TracefCallerSkip(skip int, format string, args ...interface{})
- func UpdateLoggerInstance()
- func Warn(msg string, args ...interface{})
- func Warnf(format string, args ...interface{})
- func WarnfCallerSkip(skip int, format string, args ...interface{})
- type Cache
- type ColorType
- type Config
- type ConsoleConfig
- type Field
- type FileConfig
- type Xlogger
- func (l *Xlogger) Debug(msg string, args ...interface{})
- func (l *Xlogger) Debugf(format string, args ...interface{})
- func (l *Xlogger) DebugfCallerSkip(skip int, format string, args ...interface{})
- func (l *Xlogger) Error(msg string, args ...interface{})
- func (l *Xlogger) ErrorE(err error)
- func (l *Xlogger) ErrorECallSkip(skip int, err error)
- func (l *Xlogger) Errorf(format string, args ...interface{})
- func (l *Xlogger) ErrorfCallerSkip(skip int, format string, args ...interface{})
- func (l *Xlogger) Fatal(msg string, args ...interface{})
- func (l *Xlogger) Fatalf(format string, args ...interface{})
- func (l *Xlogger) FatalfCallerSkip(skip int, format string, args ...interface{})
- func (l *Xlogger) GetLoggerBase() zerolog.Logger
- func (l *Xlogger) Info(msg string, args ...interface{})
- func (l *Xlogger) Infof(format string, args ...interface{})
- func (l *Xlogger) InfofCallerSkip(skip int, format string, args ...interface{})
- func (l *Xlogger) Sync() error
- func (l *Xlogger) Trace(msg string, args ...interface{})
- func (l *Xlogger) Tracef(format string, args ...interface{})
- func (l *Xlogger) TracefCallerSkip(skip int, format string, args ...interface{})
- func (l *Xlogger) Warn(msg string, args ...interface{})
- func (l *Xlogger) Warnf(format string, args ...interface{})
- func (l *Xlogger) WarnfCallerSkip(skip int, format string, args ...interface{})
- func (l *Xlogger) WithCallerSkip(module string, skip int) *Xlogger
Constants ¶
const (
BASE_SKIP = 3
)
Variables ¶
This section is empty.
Functions ¶
func DebugfCallerSkip ¶
func ErrorECallerSkip ¶
func ErrorfCallerSkip ¶
func FatalfCallerSkip ¶
func GetColorMessage ¶
func HexDumpCustom ¶
HexDumpCustom 支持自定义行大小的版本 输入: data - 字节数组, length - 要显示的长度, lineSize - 每行字节数(自动调整为4的倍数) 输出: 格式化的十六进制转储字符串
func InfofCallerSkip ¶
func PrintInstances ¶
func PrintInstances()
func RawWithInfo ¶
func TracefCallerSkip ¶
func UpdateLoggerInstance ¶
func UpdateLoggerInstance()
func WarnfCallerSkip ¶
Types ¶
type Config ¶
type Config struct {
ConsoleEnable bool
FileEnable bool
Sugar bool // 屏幕输出颜色,输出caller
// AddSource bool
Console ConsoleConfig
File FileConfig
}
func GetCurConfig ¶
func GetCurConfig() *Config
func GetDefaultConfig ¶
func GetDefaultConfig() *Config
type ConsoleConfig ¶
type ConsoleConfig struct {
Level string
}
type FileConfig ¶
type FileConfig struct {
Level string
Path string
MaxSize int // MB
MaxAge int // days
MaxBackups int
Compress bool // 是否压缩旧日志文件
}
Config 日志配置
type Xlogger ¶
type Xlogger struct {
// contains filtered or unexported fields
}
模块专用logger
func GetLoggerModule ¶
func (*Xlogger) DebugfCallerSkip ¶
func (*Xlogger) ErrorECallSkip ¶
func (*Xlogger) ErrorfCallerSkip ¶
func (*Xlogger) FatalfCallerSkip ¶
func (*Xlogger) GetLoggerBase ¶
func (*Xlogger) InfofCallerSkip ¶
func (*Xlogger) TracefCallerSkip ¶
func (*Xlogger) WarnfCallerSkip ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
* @Description: * @Author: moo * @Email: [email protected] * @Date: 2021-01-04 23:22:43 * @LastEditTime: 2026-01-08 12:08:09 * @LastEditors: linzhengmao
|
* @Description: * @Author: moo * @Email: [email protected] * @Date: 2021-01-04 23:22:43 * @LastEditTime: 2026-01-08 12:08:09 * @LastEditors: linzhengmao |
|
* @Description: * @Author: linzhengmao * @Email: [email protected] * @Date: 2025-09-26 18:27:11 * @LastEditTime: 2026-01-08 14:42:23 * @LastEditors: linzhengmao
|
* @Description: * @Author: linzhengmao * @Email: [email protected] * @Date: 2025-09-26 18:27:11 * @LastEditTime: 2026-01-08 14:42:23 * @LastEditors: linzhengmao |