std

package
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 10 Imported by: 0

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

type Distributor struct {
	Channels []vlog.Channel
}

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) Open added in v0.0.75

func (inst *FileWriter) Open() error

Open 打开 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL