Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Debugln(args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorln(args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Fatalln(args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Infoln(args ...interface{})
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func Panicln(args ...interface{})
- func SetOptions(opts ...Option)
- func Trace(args ...interface{})
- func Tracef(format string, args ...interface{})
- func Traceln(args ...interface{})
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func Warnln(args ...interface{})
- func Writer() io.Writer
- type Entry
- type ErrorHandler
- type Formatter
- type JsonFormatter
- type Level
- type Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Debugln(args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Errorln(args ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(format string, args ...interface{})
- func (l *Logger) Fatalln(args ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Infoln(args ...interface{})
- func (l *Logger) Panic(args ...interface{})
- func (l *Logger) Panicf(format string, args ...interface{})
- func (l *Logger) Panicln(args ...interface{})
- func (l *Logger) SetOptions(opts ...Option)
- func (l *Logger) Trace(args ...interface{})
- func (l *Logger) Tracef(format string, args ...interface{})
- func (l *Logger) Traceln(args ...interface{})
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(format string, args ...interface{})
- func (l *Logger) Warnln(args ...interface{})
- func (l *Logger) Write(data []byte) (int, error)
- func (l *Logger) Writer() io.Writer
- type MutexWrap
- type Option
- type TextFormatter
Constants ¶
View Source
const ( FmtEmptySeparate = "" FmtLineSeparate = "\n" )
Variables ¶
View Source
var LevelNameMapping = map[Level]string{ PanicLevel: "PANIC", FatalLevel: "FATAL", ErrorLevel: "ERROR", WarnLevel: "WARN", InfoLevel: "INFO", DebugLevel: "DEBUG", TraceLevel: "TRACE", }
log level string name mapping
Functions ¶
func SetOptions ¶
func SetOptions(opts ...Option)
Types ¶
type JsonFormatter ¶
type JsonFormatter struct { // 忽略基础字段 IgnoreBasicFields bool }
func (*JsonFormatter) Format ¶
func (f *JsonFormatter) Format(e *Entry) error
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) SetOptions ¶
type Option ¶
type Option func(*option)
func WithErrorHandler ¶
func WithErrorHandler(handler ErrorHandler) Option
func WithFileLine ¶
func WithFormatter ¶
func WithNoLock ¶
func WithStdLevel ¶
type TextFormatter ¶
type TextFormatter struct {
IgnoreBasicFields bool
}
func (*TextFormatter) Format ¶
func (f *TextFormatter) Format(e *Entry) error
Click to show internal directories.
Click to hide internal directories.