Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOptions ¶ added in v1.0.6
func NewOptions(opts ...option) []option
NewOptions 创建选项,因为option接口不对外暴露,如果用户想在外面创建option并赋值将无法完成,特意提供创建option的快捷方式
Types ¶
type LogType ¶
type LogType string
LogType 日志类型
const ( // LogTypeDebug 调试日志 LogTypeDebug LogType = "debug" // LogTypeInfo 普通信息日志 LogTypeInfo LogType = "debug" // LogTypeWarn 警告日志 LogTypeWarn LogType = "debug" // LogTypeError 错误日志 LogTypeError LogType = "debug" // LogTypePanic 异常日志,程序会退出,可以使用recover机制来阻止程序退出 LogTypePanic LogType = "debug" // LogTypeFatal 致命错误日志,程序会退出 LogTypeFatal LogType = "debug" )
type Logger ¶
type Logger interface { // Debug 记录调试日志 Debug(msg string, fields ...gox.Field) // Info 记录普通信息日志 Info(msg string, fields ...gox.Field) // Warn 记录警告日志 Warn(msg string, fields ...gox.Field) // Error 记录错误日志 Error(msg string, fields ...gox.Field) // Panic 记录异常日志,程序会退出,可以使用recover机制来阻止程序退出 Panic(msg string, fields ...gox.Field) // Fatal 记录致命错误日志,程序会退出 Fatal(msg string, fields ...gox.Field) }
Logger 日志接口
Click to show internal directories.
Click to hide internal directories.