Documentation ¶
Index ¶
- func AddGlobalFields(field string)
- func ClearGlobalFields()
- func FullCallerEncoder() func(file string, line int) string
- func GetGlobalFields() []string
- func GetGoroutineID() uint64
- func GetZeroLogger() *zerolog.Logger
- func LowercaseLevelEncoder() func(l zerolog.Level) string
- func ResetGlobalMdcAdapter()
- func SetGlobalFields(fields []string)
- func SetLogger(configItems ...ConfigItem) gin.HandlerFunc
- func ShortCallerEncoder() func(file string, line int) string
- func TrimmedPath(file string) string
- func UppercaseLevelEncoder() func(l zerolog.Level) string
- func Z() *zerolog.Logger
- type Config
- type ConfigItem
- type MDCHook
- type MdcAdapter
- func (m *MdcAdapter) Count() int
- func (m *MdcAdapter) Get(key string) (interface{}, bool)
- func (m *MdcAdapter) GetString(key string) string
- func (m *MdcAdapter) Has(key string) bool
- func (m *MdcAdapter) IsEmpty() bool
- func (m *MdcAdapter) Keys() []string
- func (m *MdcAdapter) Remove(key string)
- func (m *MdcAdapter) Set(key string, value interface{})
- func (m *MdcAdapter) SetIfAbsent(key string, value interface{}) bool
- func (m *MdcAdapter) SetMap(data map[string]interface{})
- type Overlog
- func (o *Overlog) Debug() *zerolog.Event
- func (o *Overlog) Debugf(format string, args ...interface{})
- func (o *Overlog) Error() *zerolog.Event
- func (o *Overlog) Errorf(format string, args ...interface{})
- func (o *Overlog) Fatal(args ...interface{})
- func (o *Overlog) Fatalf(format string, args ...interface{})
- func (o *Overlog) Info() *zerolog.Event
- func (o *Overlog) Infof(format string, args ...interface{})
- func (o *Overlog) Log(args ...interface{})
- func (o *Overlog) Logf(format string, args ...interface{})
- func (o *Overlog) ODebug(args ...interface{})
- func (o *Overlog) OError(args ...interface{})
- func (o *Overlog) OInfo(args ...interface{})
- func (o *Overlog) OPanic(args ...interface{})
- func (o *Overlog) Panic() *zerolog.Event
- func (o *Overlog) Panicf(format string, args ...interface{})
- func (o *Overlog) Print(args ...interface{})
- func (o *Overlog) Printf(format string, args ...interface{})
- func (o *Overlog) Trace(args ...interface{})
- func (o *Overlog) Tracef(format string, args ...interface{})
- func (o *Overlog) Warn(args ...interface{})
- func (o *Overlog) Warnf(format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddGlobalFields ¶
func AddGlobalFields(field string)
func ClearGlobalFields ¶
func ClearGlobalFields()
func GetGlobalFields ¶
func GetGlobalFields() []string
func GetGoroutineID ¶
func GetGoroutineID() uint64
func GetZeroLogger ¶
func LowercaseLevelEncoder ¶
这个为什么叫Lowercase呢,默认就是小写?
func ResetGlobalMdcAdapter ¶
func ResetGlobalMdcAdapter()
func SetGlobalFields ¶
func SetGlobalFields(fields []string)
func SetLogger ¶
func SetLogger(configItems ...ConfigItem) gin.HandlerFunc
func UppercaseLevelEncoder ¶
Types ¶
type ConfigItem ¶
type ConfigItem interface {
// contains filtered or unexported methods
}
func SetAppId ¶
func SetAppId(appId string) ConfigItem
func SetRequestIdKey ¶
func SetRequestIdKey(requestIdKey string) ConfigItem
func SetSessionid ¶
func SetSessionid(sessionIdKey string) ConfigItem
func SetUserIdKey ¶
func SetUserIdKey(userIdKey string) ConfigItem
type MdcAdapter ¶
func InitGlobalMdcAdapter ¶
func InitGlobalMdcAdapter() *MdcAdapter
func MDC ¶
func MDC() *MdcAdapter
func (*MdcAdapter) Count ¶
func (m *MdcAdapter) Count() int
func (*MdcAdapter) Get ¶
func (m *MdcAdapter) Get(key string) (interface{}, bool)
func (*MdcAdapter) GetString ¶
func (m *MdcAdapter) GetString(key string) string
func (*MdcAdapter) Has ¶
func (m *MdcAdapter) Has(key string) bool
func (*MdcAdapter) IsEmpty ¶
func (m *MdcAdapter) IsEmpty() bool
func (*MdcAdapter) Keys ¶
func (m *MdcAdapter) Keys() []string
func (*MdcAdapter) Remove ¶
func (m *MdcAdapter) Remove(key string)
func (*MdcAdapter) Set ¶
func (m *MdcAdapter) Set(key string, value interface{})
func (*MdcAdapter) SetIfAbsent ¶
func (m *MdcAdapter) SetIfAbsent(key string, value interface{}) bool
func (*MdcAdapter) SetMap ¶
func (m *MdcAdapter) SetMap(data map[string]interface{})
type Overlog ¶
type Overlog struct {
// contains filtered or unexported fields
}
func NewDefault ¶
func NewDefault() *Overlog
Source Files ¶
Click to show internal directories.
Click to hide internal directories.