glog

package module
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: MIT Imports: 12 Imported by: 0

README

glog

Documentation

Index

Constants

View Source
const (
	FieldKeyModule = "module"
)

Variables

This section is empty.

Functions

func Init

func Init(appName, module string)

func NewWriterConfigLogstash

func NewWriterConfigLogstash() *adaptor.ConfigLogstash

func UseKafka

func UseKafka(zkHosts []string)

Types

type Entry

type Entry struct {
	logrus.Entry
}

func WithModule

func WithModule(module string) *Entry

func (*Entry) WithPanicStack

func (e *Entry) WithPanicStack() *Entry

函数在recover层级调用

type Hook

type Hook struct {
	// contains filtered or unexported fields
}

func (Hook) Fire

func (l Hook) Fire(entry *logrus.Entry) error

func (Hook) Levels

func (l Hook) Levels() []logrus.Level

type Processor

type Processor struct {
	adaptor.CoreBase
	// contains filtered or unexported fields
}

日志处理类

func NewProcessor

func NewProcessor(appName, modulePrefix string) *Processor

func (*Processor) AddWriters

func (p *Processor) AddWriters(writerConfigs ...adaptor.WriterConfig)

func (*Processor) GetHook

func (p *Processor) GetHook() *Hook

type TextFormatter

type TextFormatter struct {
}

func (TextFormatter) Format

func (t TextFormatter) Format(e *logrus.Entry) (o []byte, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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