Documentation ¶
Index ¶
- Constants
- Variables
- func Critical(v ...interface{})
- func Criticalf(format string, v ...interface{})
- func Criticalln(v ...interface{})
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Debugln(v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Errorln(v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Fatalln(v ...interface{})
- func Flags() int
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Infoln(v ...interface{})
- func Levels() int
- func Panic(v ...interface{})
- func Panicf(format string, v ...interface{})
- func Panicln(v ...interface{})
- func ParseLevel(level string) int
- func Print(v ...interface{})
- func Printf(format string, v ...interface{})
- func Println(v ...interface{})
- func SetFlags(flag int)
- func SetLevel(level interface{})
- func SetOutput(w io.Writer)
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- func Warnln(v ...interface{})
- type Logger
- func (l *Logger) Critical(v ...interface{})
- func (l *Logger) Criticalf(format string, v ...interface{})
- func (l *Logger) Criticalln(v ...interface{})
- func (l *Logger) Debug(v ...interface{})
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Debugln(v ...interface{})
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Errorln(v ...interface{})
- func (l *Logger) Fatal(v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Fatalln(v ...interface{})
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) Infoln(v ...interface{})
- func (l *Logger) Levels() int
- func (l *Logger) Output(calldepth int, s string) error
- func (l *Logger) Panic(v ...interface{})
- func (l *Logger) Panicf(format string, v ...interface{})
- func (l *Logger) Panicln(v ...interface{})
- func (l *Logger) Print(v ...interface{})
- func (l *Logger) Printf(format string, v ...interface{})
- func (l *Logger) Println(v ...interface{})
- func (l *Logger) SetLevel(level interface{})
- func (l *Logger) SetOutput(w io.Writer)
- func (l *Logger) Warn(v ...interface{})
- func (l *Logger) Warnf(format string, v ...interface{})
- func (l *Logger) Warnln(v ...interface{})
Constants ¶
View Source
const ( // Bits or'ed together to control what's printed. There is no control over the // order they appear (the order listed here) or the format they present (as // described in the comments). A colon appears after these items: // [log] 2009/01/23 01:23:23.123123 /a/b/c/d.go:23: message Ldate = log.Ldate // the date: 2009/01/23 Ltime = log.Ltime // the time: 01:23:23 Lmicroseconds = log.Lmicroseconds // microsecond resolution: 01:23:23.123123. assumes Ltime. Llongfile = log.Llongfile // full file name and line number: /a/b/c/d.go:23 Lshortfile = log.Lshortfile // final file name element and line number: d.go:23. overrides Llongfile LUTC = log.LUTC // if Ldate or Ltime is set, use UTC rather than the local time zone Lpackage = log.LUTC << 1 // package name: [log] Lfunction = Lpackage << 1 // function name: <Print> LstdFlags = Ldate | Ltime | Lmicroseconds | Lshortfile | Lpackage | Lfunction // initial values for the standard logger Ldevelop = Ldate | Ltime | Lmicroseconds | Llongfile | Lpackage | Lfunction Lproduction = Ldate | Ltime | Lmicroseconds | Lpackage | Lfunction )
These flags define which text to prefix to each log entry generated by the Logger.
View Source
const ( LEVEL_DISABLE = 0 //关闭日志功能 LEVEL_DEBUG = 1 << iota LEVEL_INFO LEVEL_WARN LEVEL_ERROR LEVEL_CRITICAL LEVEL_PANIC )
日志级别
View Source
const ( LEVEL_FATAL = "[FATAL]" LEVEL_ALL = LEVEL_DEBUG | LEVEL_INFO | LEVEL_WARN | LEVEL_ERROR | LEVEL_CRITICAL | LEVEL_PANIC //默认日志级别为 LEVEL_DEFAULT = LEVEL_ALL )
Variables ¶
View Source
var ( LevelText = map[string]int{ "disable": LEVEL_DISABLE, "debug": LEVEL_DEBUG, "info": LEVEL_INFO, "warn": LEVEL_WARN, "error": LEVEL_ERROR, "critical": LEVEL_CRITICAL, "panic": LEVEL_PANIC, "all": LEVEL_ALL, } )
Functions ¶
func Criticalln ¶
func Criticalln(v ...interface{})
func ParseLevel ¶
Types ¶
type Logger ¶
func (*Logger) Criticalln ¶
func (l *Logger) Criticalln(v ...interface{})
Click to show internal directories.
Click to hide internal directories.