Documentation ¶
Index ¶
- Constants
- func AddWriter(w io.Writer)
- func CbDebug(v ...interface{})
- func CbDebugf(format string, v ...interface{})
- func CbError(v ...interface{})
- func CbErrorf(format string, v ...interface{})
- func CbInfo(v ...interface{})
- func CbInfof(format string, v ...interface{})
- func CbWarn(v ...interface{})
- func CbWarnf(format string, v ...interface{})
- func Debug(v ...interface{})
- func Debugf(f string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(f string, v ...interface{})
- func Exit(msg string, exitCode ...int)
- func GetAppName() string
- func GetCallerFrame(skip int) (frame *runtime.Frame, ok bool)
- func GetWriter() io.Writer
- func Info(v ...interface{})
- func Infof(f string, v ...interface{})
- func Init(logType string, haveColor bool)
- func Level() int
- func LiteDebug(s string, v ...interface{})
- func LiteError(s string, v ...interface{})
- func LiteInfo(s string, v ...interface{})
- func LiteWarn(s string, v ...interface{})
- func Msg(msg string, level ...int)
- func SetLevel(l zapcore.Level)
- func SetLogger(adapter string, config ...string) error
- func SetStringLevel(l string)
- func TrimmedPath(frame *runtime.Frame) string
- func Warn(v ...interface{})
- func Warnf(f string, v ...interface{})
- func Where(l int) string
Constants ¶
View Source
const ( // LevelDebug defines debug log level. LevelDebug = zap.DebugLevel // LevelInfo defines info log level. LevelInfo = zap.InfoLevel // LevelWarn defines warn log level. LevelWarn = zap.WarnLevel // LevelError defines error log level. LevelError = zap.ErrorLevel AdapterConsole = "console" AdapterFile = "file" )
常量定义
Variables ¶
This section is empty.
Functions ¶
func CbDebugf ¶
func CbDebugf(format string, v ...interface{})
CbDebugf logs a message at debug level.
func CbErrorf ¶
func CbErrorf(format string, v ...interface{})
CbErrorf logs a message at error level.
func CbInfof ¶
func CbInfof(format string, v ...interface{})
CbInfof compatibility alias for Warning()
func CbWarnf ¶
func CbWarnf(format string, v ...interface{})
CbWarnf compatibility alias for Warning()
func Init ¶
*
- @description: 日志初始化
- @param {string} logType 日志类型 json/txt
- @param {bool} haveColor 日志是否输出颜色
- @return {*}
func SetStringLevel ¶
func SetStringLevel(l string)
*
- @description: 用字符串的方式设置日志级别
- @param {string} l
- @return {*}
func TrimmedPath ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.