formatter

package
v0.0.0-...-9c04300 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimeLayout = "2006-01-02 15:04:05.000"

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

type Formatter interface {
	Format(*logis.Log) ([]byte, error)
}

type JsonFormatter

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

func Json

func Json() *JsonFormatter

func (*JsonFormatter) Format

func (formatter *JsonFormatter) Format(log *logis.Log) ([]byte, error)

序列化日志

func (*JsonFormatter) TimeLayout

func (formatter *JsonFormatter) TimeLayout(layout string) *JsonFormatter

设置时间序列化规则

type TextFormatter

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

func Text

func Text() *TextFormatter

func (*TextFormatter) Format

func (f *TextFormatter) Format(log *logis.Log) ([]byte, error)

序列化日志

func (*TextFormatter) LevelLayout

func (f *TextFormatter) LevelLayout(strings map[logis.Level]string) *TextFormatter

设置消息等级文本

func (*TextFormatter) TimeLayout

func (f *TextFormatter) TimeLayout(layout string) *TextFormatter

设置时间序列化规则

Jump to

Keyboard shortcuts

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