Documentation ¶
Index ¶
- func FilterFlags(args []string) []string
- func GinAPILogger(logger ...*logrus.Entry) gin.HandlerFunc
- func GinLogger(logger ...*logrus.Entry) gin.HandlerFunc
- func GinMultiWriter(gw gin.ResponseWriter, w io.Writer) gin.ResponseWriter
- func TeeReadCloser(rc io.ReadCloser, w io.Writer) io.ReadCloser
- type BaseHook
- type ClassicFormatter
- type FileHook
- type HookSetuper
- type NullFormatter
- type ShortLevel
- type StderrHook
- type StdoutHook
- type UDPHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GinAPILogger ¶
func GinAPILogger(logger ...*logrus.Entry) gin.HandlerFunc
func GinLogger ¶
func GinLogger(logger ...*logrus.Entry) gin.HandlerFunc
GinLogger is the qlog logger for GIN, copy from https://github.com/toorop/gin-logrus
func GinMultiWriter ¶
func GinMultiWriter(gw gin.ResponseWriter, w io.Writer) gin.ResponseWriter
func TeeReadCloser ¶
func TeeReadCloser(rc io.ReadCloser, w io.Writer) io.ReadCloser
Types ¶
type BaseHook ¶
BaseHook for some common function for hooks in qlog
type ClassicFormatter ¶
type ClassicFormatter struct { // TimestampFormat sets the format used for marshaling timestamps. TimestampFormat string // DisableTimestamp allows disabling automatic timestamps in output DisableTimestamp bool // CallerPrettyfier can be set by the user to modify the content // of the function and file keys in the data when ReportCaller is // activated. If any of the returned value is the empty string the // corresponding key will be removed from fields. CallerPrettyfier func(*runtime.Frame) (function string, file string) }
ClassicFormatter formats logs into parsable json
type FileHook ¶
type FileHook struct { BaseHook FilePath string FileName string // Rotate params RotateTime time.Duration // 0 means do not rotate RotateMaxAge time.Duration // time to wait until old logs are purged, default 7 days, set 0 to disable RotateCount uint // the number of files should be kept, default 0 means disabled }
FileHook implement file support of logger hook
type HookSetuper ¶
type HookSetuper interface {
Setup() error
}
HookSetuper is the base interface a qlog hook must implement
type ShortLevel ¶
type ShortLevel uint32
ShortLevel is a simple char to indicate log level
func (ShortLevel) String ¶
func (level ShortLevel) String() string
Convert the Level to a string. E.g. PanicLevel becomes "panic".
Source Files ¶
Click to show internal directories.
Click to hide internal directories.