Documentation ¶
Index ¶
- Constants
- func IsEnable() bool
- func PrintErr(v ...interface{})
- func PrintInfo(v ...interface{})
- func PrintfErr(format string, v ...interface{})
- func PrintfInfo(format string, v ...interface{})
- type Entry
- func (p *Entry) Debug(v ...interface{})
- func (p *Entry) Debugf(format string, v ...interface{})
- func (p *Entry) Error(v ...interface{})
- func (p *Entry) Errorf(format string, v ...interface{})
- func (p *Entry) Fatal(v ...interface{})
- func (p *Entry) Fatalf(format string, v ...interface{})
- func (p *Entry) Info(v ...interface{})
- func (p *Entry) Infof(format string, v ...interface{})
- func (p *Entry) Trace(v ...interface{})
- func (p *Entry) Tracef(format string, v ...interface{})
- func (p *Entry) Warn(v ...interface{})
- func (p *Entry) Warnf(format string, v ...interface{})
- func (p *Entry) WithContext(ctx context.Context) *Entry
- func (p *Entry) WithField(key string, value interface{}) *Entry
- func (p *Entry) WithFields(fields fields) *Entry
- type Hook
- type Level
- type LevelHooks
- type Mgr
- func (p *Mgr) Debug(v ...interface{})
- func (p *Mgr) Debugf(format string, v ...interface{})
- func (p *Mgr) Error(v ...interface{})
- func (p *Mgr) Errorf(format string, v ...interface{})
- func (p *Mgr) Fatal(v ...interface{})
- func (p *Mgr) Fatalf(format string, v ...interface{})
- func (p *Mgr) GetLevel() Level
- func (p *Mgr) Info(v ...interface{})
- func (p *Mgr) Infof(format string, v ...interface{})
- func (p *Mgr) SetLevel(lv Level) error
- func (p *Mgr) Start(_ context.Context, opts ...*Options) error
- func (p *Mgr) Stop() error
- func (p *Mgr) Trace(v ...interface{})
- func (p *Mgr) Tracef(format string, v ...interface{})
- func (p *Mgr) Warn(v ...interface{})
- func (p *Mgr) Warnf(format string, v ...interface{})
- func (p *Mgr) WithContext(ctx context.Context) *Entry
- func (p *Mgr) WithField(key string, value interface{}) *Entry
- func (p *Mgr) WithFields(f fields) *Entry
- type Options
- func (p *Options) AddHooks(hook Hook) *Options
- func (p *Options) IsEnablePool() bool
- func (p *Options) WithAbsPath(absPath string) *Options
- func (p *Options) WithEnablePool(enablePool bool) *Options
- func (p *Options) WithHooks(hooks LevelHooks) *Options
- func (p *Options) WithIsReportCaller(isReportCaller bool) *Options
- func (p *Options) WithIsWriteFile(isWriteFile bool) *Options
- func (p *Options) WithLevel(level Level) *Options
- func (p *Options) WithNamePrefix(namePrefix string) *Options
Constants ¶
View Source
const ( TraceIDKey = "TraceID" // 日志traceId key UserIDKey = "UID" // 日志用户ID key )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
Entry 日志数据信息
func (*Entry) WithContext ¶
WithContext 由ctx创建Entry
func (*Entry) WithFields ¶
WithFields 由多个field创建Entry
type LevelHooks ¶
type Mgr ¶
type Mgr struct {
// contains filtered or unexported fields
}
Mgr 日志
func (*Mgr) WithContext ¶
WithContext 由ctx创建日志信息
func (*Mgr) WithFields ¶
WithFields 由fields创建日志信息 默认大小4(cap:4*2=8)
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options contains Options to configure a server instance. Each option can be set through setter functions. See documentation for each setter function for an explanation of the option.
func (*Options) IsEnablePool ¶
func (*Options) WithAbsPath ¶
func (*Options) WithEnablePool ¶
func (*Options) WithHooks ¶
func (p *Options) WithHooks(hooks LevelHooks) *Options
func (*Options) WithIsReportCaller ¶
func (*Options) WithIsWriteFile ¶
func (*Options) WithNamePrefix ¶
Click to show internal directories.
Click to hide internal directories.