Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsoleWriter ¶
type ConsoleWriter struct {
// contains filtered or unexported fields
}
func (*ConsoleWriter) Write ¶
func (inst *ConsoleWriter) Write(rec *vlog.Record)
type Context ¶
type Context interface {
GetDefaultLevel() vlog.Level
GetDefaultFormatter() vlog.Formatter
GetMainChannel() vlog.Channel
}
Context 日志上下文
type DefaultContext ¶
type DefaultContext struct {
DefaultLevel string
DefaultFormatter vlog.Formatter
Channels []vlog.Channel
MainChannel vlog.Channel
// contains filtered or unexported fields
}
DefaultContext 日志上下文
func (*DefaultContext) GetDefaultFormatter ¶
func (inst *DefaultContext) GetDefaultFormatter() vlog.Formatter
GetDefaultFormatter 取默认的 formatter
func (*DefaultContext) GetDefaultLevel ¶
func (inst *DefaultContext) GetDefaultLevel() vlog.Level
GetDefaultLevel 取默认的日志等级
func (*DefaultContext) GetMainChannel ¶
func (inst *DefaultContext) GetMainChannel() vlog.Channel
GetMainChannel 取主通道
type DefaultFormatter ¶
type DefaultFormatter struct {
vlog.SimpleFormatter
}
type Distributor ¶
Distributor 把 rec 分发到多个channel
func (*Distributor) Write ¶
func (inst *Distributor) Write(rec *vlog.Record)
type FileWriter ¶ added in v0.0.75
type FileWriter struct {
Enable bool
Path1 string
Path2 string
Context application.Context
// contains filtered or unexported fields
}
FileWriter 是 vlog 的文件写入器
func (*FileWriter) Close ¶ added in v0.0.75
func (inst *FileWriter) Close() error
Close 关闭 FileWriter
func (*FileWriter) Write ¶ added in v0.0.75
func (inst *FileWriter) Write(rec *vlog.Record)
type LogChannel ¶
type LogChannel struct {
// public
Context Context
Name string
Enable bool
Filters []vlog.Filter
Writer vlog.Writer
Level string
Formatter vlog.Formatter
// contains filtered or unexported fields
}
LogChannel 日志通道
func (*LogChannel) IsLevelEnabled ¶
func (inst *LogChannel) IsLevelEnabled(level vlog.Level) bool
IsLevelEnabled 判断给定的日志等级是否可用
func (*LogChannel) Write ¶
func (inst *LogChannel) Write(r *vlog.Record)
type StandardLoggerFactory ¶
type StandardLoggerFactory struct {
// public
Context Context
// contains filtered or unexported fields
}
StandardLoggerFactory 标准的日志工厂
func (*StandardLoggerFactory) CreateLogger ¶
func (inst *StandardLoggerFactory) CreateLogger(source interface{}) vlog.Logger
func (*StandardLoggerFactory) Start ¶
func (inst *StandardLoggerFactory) Start() error
func (*StandardLoggerFactory) Stop ¶
func (inst *StandardLoggerFactory) Stop() error
Click to show internal directories.
Click to hide internal directories.