Documentation ¶
Overview ¶
Package glog implements powerful and easy-to-use levelled logging functionality.
日志模块, 直接文件/输出操作,没有异步逻辑,没有使用缓存或者通道
Index ¶
- Constants
- func Critical(v ...interface{})
- func Criticalf(format string, v ...interface{})
- func Criticalfln(format string, v ...interface{})
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Debugfln(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Errorfln(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Fatalfln(format string, v ...interface{})
- func GetBacktrace(skip ...int) string
- func GetLevel() int
- func GetPath() string
- func GetWriter() io.Writer
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Infofln(format string, v ...interface{})
- func Notice(v ...interface{})
- func Noticef(format string, v ...interface{})
- func Noticefln(format string, v ...interface{})
- func Panic(v ...interface{})
- func Panicf(format string, v ...interface{})
- func Panicfln(format string, v ...interface{})
- func Print(v ...interface{})
- func PrintBacktrace(skip ...int)
- func Printf(format string, v ...interface{})
- func Printfln(format string, v ...interface{})
- func Println(v ...interface{})
- func SetBacktrace(enabled bool)
- func SetDebug(debug bool)
- func SetFile(file string)
- func SetLevel(level int)
- func SetPath(path string)
- func SetStdPrint(open bool)
- func SetWriter(writer io.Writer)
- func Warning(v ...interface{})
- func Warningf(format string, v ...interface{})
- func Warningfln(format string, v ...interface{})
- type Logger
- func (l *Logger) Backtrace(enabled bool, skip ...int) *Logger
- func (l *Logger) Cat(category string) *Logger
- func (l *Logger) Clone() *Logger
- func (l *Logger) Critical(v ...interface{})
- func (l *Logger) Criticalf(format string, v ...interface{})
- func (l *Logger) Criticalfln(format string, v ...interface{})
- func (l *Logger) Debug(v ...interface{})
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Debugfln(format string, v ...interface{})
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Errorfln(format string, v ...interface{})
- func (l *Logger) Fatal(v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Fatalfln(format string, v ...interface{})
- func (l *Logger) File(file string) *Logger
- func (l *Logger) GetBacktrace(skip ...int) string
- func (l *Logger) GetLevel() int
- func (l *Logger) GetPath() string
- func (l *Logger) GetWriter() io.Writer
- func (l *Logger) Header(enabled bool) *Logger
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) Infofln(format string, v ...interface{})
- func (l *Logger) Level(level int) *Logger
- func (l *Logger) Notice(v ...interface{})
- func (l *Logger) Noticef(format string, v ...interface{})
- func (l *Logger) Noticefln(format string, v ...interface{})
- func (l *Logger) Panic(v ...interface{})
- func (l *Logger) Panicf(format string, v ...interface{})
- func (l *Logger) Panicfln(format string, v ...interface{})
- func (l *Logger) Print(v ...interface{})
- func (l *Logger) PrintBacktrace(skip ...int)
- func (l *Logger) Printf(format string, v ...interface{})
- func (l *Logger) Printfln(format string, v ...interface{})
- func (l *Logger) Println(v ...interface{})
- func (l *Logger) SetBacktrace(enabled bool)
- func (l *Logger) SetBacktraceSkip(skip int)
- func (l *Logger) SetDebug(debug bool)
- func (l *Logger) SetFile(file string)
- func (l *Logger) SetLevel(level int)
- func (l *Logger) SetPath(path string) error
- func (l *Logger) SetStdPrint(enabled bool)
- func (l *Logger) SetWriter(writer io.Writer)
- func (l *Logger) StdPrint(enabled bool) *Logger
- func (l *Logger) To(writer io.Writer) *Logger
- func (l *Logger) Warning(v ...interface{})
- func (l *Logger) Warningf(format string, v ...interface{})
- func (l *Logger) Warningfln(format string, v ...interface{})
Constants ¶
View Source
const ( LEVEL_ALL = LEVEL_DEBU | LEVEL_INFO | LEVEL_NOTI | LEVEL_WARN | LEVEL_ERRO | LEVEL_CRIT LEVEL_DEBU = 1 << iota LEVEL_INFO LEVEL_NOTI LEVEL_WARN LEVEL_ERRO LEVEL_CRIT )
Variables ¶
This section is empty.
Functions ¶
func Criticalfln ¶
func Criticalfln(format string, v ...interface{})
func Warningfln ¶
func Warningfln(format string, v ...interface{})
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) Cat ¶
链式操作,设置下一次输出的日志分类(可以按照文件目录层级设置),在当前logpath或者当前工作目录下创建category目录, 这是一个链式操作,可以设置多个分类,将会创建层级的日志分类目录。
func (*Logger) Criticalfln ¶
func (*Logger) GetBacktrace ¶ added in v1.5.0
获取文件调用回溯字符串,参数skip表示调用端往上多少级开始回溯
func (*Logger) PrintBacktrace ¶ added in v1.5.0
直接打印回溯信息,参数skip表示调用端往上多少级开始回溯
func (*Logger) SetBacktrace ¶ added in v1.5.0
func (*Logger) SetBacktraceSkip ¶ added in v1.5.0
设置BacktraceSkip
func (*Logger) SetStdPrint ¶ added in v1.5.0
设置写日志时开启or关闭控制台打印,默认是关闭的
func (*Logger) Warningfln ¶
Click to show internal directories.
Click to hide internal directories.