Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(v ...interface{})
- func Dump(v ...interface{})
- func Error(v ...interface{})
- func Header(v ...interface{})
- func Info(v ...interface{})
- func Json(v ...interface{})
- func Mark(i ...int)
- func Print(v interface{})
- func SetGlobalFormatter(f logrus.Formatter)
- func SetGlobalLogLevel(l logrus.Level)
- func Warn(v ...interface{})
- type Logger
- type Packet
- type StackTrace
Constants ¶
View Source
const ( LevelFatal = logrus.FatalLevel LevelPanic = logrus.PanicLevel LevelError = logrus.ErrorLevel LevelWarn = logrus.WarnLevel LevelInfo = logrus.InfoLevel LevelDebug = logrus.DebugLevel )
Variables ¶
View Source
var ( LevelsPanic = []logrus.Level{ logrus.FatalLevel, logrus.PanicLevel, } LevelsError = append(LevelsPanic, logrus.ErrorLevel) LevelsWarn = append(LevelsError, logrus.WarnLevel) LevelsInfo = append(LevelsWarn, logrus.InfoLevel) LevelsDebug = append(LevelsInfo, logrus.DebugLevel) )
log levels
View Source
var Nothing int
Nothing is dummy variable for import error
Functions ¶
func SetGlobalFormatter ¶ added in v0.4.0
SetGlobalFormatter sets Fomatter.
func SetGlobalLogLevel ¶ added in v0.4.0
SetGlobalLogLevel sets log level.
Types ¶
type Logger ¶ added in v0.4.0
Logger is wrapper struct of *logrus.Logger.
func (*Logger) DisableOutput ¶ added in v0.4.0
func (l *Logger) DisableOutput()
DisableOutput disables output.
func (*Logger) SetFormatter ¶ added in v0.4.0
SetFormatter sets Fomatter.
func (*Logger) SetLogLevel ¶ added in v0.4.0
SetLogLevel sets log level.
type Packet ¶
type Packet struct { *Logger Title string Data interface{} Err error Request *http.Request Context context.Context SQL string Engine string UserID string Tag string Trace int // stacktrace depth TraceSkip int TraceData interface{} NoTrace bool DataList []interface{} }
Packet is struct for log data
type StackTrace ¶
func GetTraces ¶
func GetTraces(depth, skip int) []StackTrace
func Trace ¶
func Trace(depth int) (StackTrace, bool)
func (StackTrace) String ¶
func (s StackTrace) String() string
Click to show internal directories.
Click to hide internal directories.