Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(i ...interface{})
- func Debugf(format string, args ...interface{})
- func Debugj(j log.JSON)
- func Error(i ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorj(j log.JSON)
- func Fatal(i ...interface{})
- func Fatalf(format string, args ...interface{})
- func Fatalj(j log.JSON)
- func Info(i ...interface{})
- func Infof(format string, args ...interface{})
- func Infoj(j log.JSON)
- func Middleware() echo.MiddlewareFunc
- func MiddlewareWithConfig(reqConfig ReqConfig, resConfig ResConfig) echo.MiddlewareFunc
- func Panic(i ...interface{})
- func Panicf(format string, args ...interface{})
- func Panicj(j log.JSON)
- func Print(i ...interface{})
- func Printf(format string, i ...interface{})
- func Printj(j log.JSON)
- func Warn(i ...interface{})
- func Warnf(format string, args ...interface{})
- func Warnj(j log.JSON)
- type APILogger
- func (l *APILogger) Debug(i ...interface{})
- func (l *APILogger) Debugf(format string, args ...interface{})
- func (l *APILogger) Debugj(j log.JSON)
- func (l *APILogger) DisableTraceback()
- func (l *APILogger) EnableTraceback()
- func (l *APILogger) Error(i ...interface{})
- func (l *APILogger) Errorf(format string, args ...interface{})
- func (l *APILogger) Errorj(j log.JSON)
- func (l *APILogger) Fatal(i ...interface{})
- func (l *APILogger) Fatalf(format string, args ...interface{})
- func (l *APILogger) Fatalj(j log.JSON)
- func (l *APILogger) Formatter() logrus.Formatter
- func (l *APILogger) Info(i ...interface{})
- func (l *APILogger) Infof(format string, args ...interface{})
- func (l *APILogger) Infoj(j log.JSON)
- func (l *APILogger) Level() log.Lvl
- func (l *APILogger) Output() io.Writer
- func (l *APILogger) Panic(i ...interface{})
- func (l *APILogger) Panicf(format string, args ...interface{})
- func (l *APILogger) Panicj(j log.JSON)
- func (l *APILogger) Prefix() string
- func (l *APILogger) Print(i ...interface{})
- func (l *APILogger) Printf(format string, args ...interface{})
- func (l *APILogger) Printj(j log.JSON)
- func (l *APILogger) SetFormatter(formatter logrus.Formatter)
- func (l *APILogger) SetHeader(h string)
- func (l *APILogger) SetLevel(v log.Lvl)
- func (l *APILogger) SetOutput(w io.Writer)
- func (l *APILogger) SetOutputs(w ...io.Writer)
- func (l *APILogger) SetPrefix(p string)
- func (l *APILogger) Warn(i ...interface{})
- func (l *APILogger) Warnf(format string, args ...interface{})
- func (l *APILogger) Warnj(j log.JSON)
- type ReqConfig
- type ResConfig
Constants ¶
const ( DEBUG log.Lvl = iota + 1 INFO WARN ERROR OFF )
Variables ¶
var ( DefaultReqConfig = ReqConfig{ Fields: []string{ "id", "remote_ip", "host", "method", "uri", "user_agent", "bytes_in", }, Level: INFO, Message: "REQUEST", } DefaultResConfig = ResConfig{ Fields: []string{ "id", "remote_ip", "host", "method", "uri", "user_agent", "status", "error", "latency", "latency_human", "bytes_in", "bytes_out", }, Level: INFO, Message: "RESPONSE", } )
Functions ¶
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf output format message of debug level
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf output format message of error level
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf output format message of fatal level
func Infof ¶
func Infof(format string, args ...interface{})
Infof output format message of info level
func MiddlewareWithConfig ¶
Logger Middleware Function
func Panicf ¶
func Panicf(format string, args ...interface{})
Panicf output format message of panic level
func Printf ¶
func Printf(format string, i ...interface{})
Printf output format message of print level
Types ¶
type APILogger ¶
select which fields to include select level
func (*APILogger) Debug ¶
func (l *APILogger) Debug(i ...interface{})
Debug output message of debug level
func (*APILogger) DisableTraceback ¶
func (l *APILogger) DisableTraceback()
Disables writing file, line, and function name with logs
func (*APILogger) EnableTraceback ¶
func (l *APILogger) EnableTraceback()
Enables writing file, line, and function name with logs
func (*APILogger) Error ¶
func (l *APILogger) Error(i ...interface{})
Error output message of error level
func (*APILogger) Fatal ¶
func (l *APILogger) Fatal(i ...interface{})
Fatal output message of fatal level
func (*APILogger) Info ¶
func (l *APILogger) Info(i ...interface{})
Info output message of info level
func (*APILogger) Panic ¶
func (l *APILogger) Panic(i ...interface{})
Panic output message of panic level
func (*APILogger) Print ¶
func (l *APILogger) Print(i ...interface{})
Print output message of print level
func (*APILogger) SetFormatter ¶
SetFormatter logger formatter Only support logrus formatter
func (*APILogger) SetHeader ¶
SetHeader logger header Managed by Logrus itself This function do nothing
func (*APILogger) SetOutputs ¶
SetOutput logger io.Writer
func (*APILogger) Warn ¶
func (l *APILogger) Warn(i ...interface{})
Warn output message of warn level