Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ColorReset 重置 ANSI 颜色。 ColorReset = "\033[0m" // ColorYellow 黄色(耗时/提示)。 ColorYellow = "\033[33m" // ColorBlueBold 蓝色加粗(字段高亮)。 ColorBlueBold = "\033[34;1m" // ColorRedBold 红色加粗(错误高亮)。 ColorRedBold = "\033[31;1m" // LogTypeMongo 为日志类型标识(供下游聚合检索)。 LogTypeMongo = 6 // ResultSuccess 为成功执行的结果标记。 ResultSuccess = "success" // TraceId 为从 metadata 读取 trace id 的 key。 TraceId = "trace-id" // UserId 为从 metadata 读取 user id 的 key。 UserId = "user-id" // AppId 为从 metadata 读取 app id 的 key。 AppId = "app-id" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conf ¶
type Conf struct {
// Console 控制是否输出到控制台。
Console bool
// SlowThreshold 为慢查询阈值。
SlowThreshold time.Duration
// Colorful 控制是否启用彩色输出。
Colorful bool
// Database 为库名字段,用于检索与聚合。
Database string
// LogLevel 为日志级别。
LogLevel LogLevel
}
Conf 为 logger 的配置。
Click to show internal directories.
Click to hide internal directories.