core

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fields

type Fields map[string]interface{}

func (Fields) Bytes

func (f Fields) Bytes() []byte

func (Fields) String

func (f Fields) String() string

type Format

type Format int
const (
	SIMPLE Format = iota
	FULL
	JSON
)

func NewFormat

func NewFormat(format string) Format

func (Format) String

func (f Format) String() string

type Formatter

type Formatter interface {
	Format(entry *LogEntry) *bufferpool.Buffer
}

func FormatterFactory

func FormatterFactory(format Format) Formatter

type FullFormatter

type FullFormatter struct {
}

func NewFullFormatter

func NewFullFormatter() *FullFormatter

func (*FullFormatter) Format

func (ff *FullFormatter) Format(entry *LogEntry) *bufferpool.Buffer

type JSONFormatter

type JSONFormatter struct {
}

func NewJSONFormatter

func NewJSONFormatter() *JSONFormatter

func (*JSONFormatter) Format

func (jf *JSONFormatter) Format(entry *LogEntry) *bufferpool.Buffer

type Level

type Level int
const (
	DEBUG Level = iota
	INFO
	DATA
	WARN
	ERROR
	FATAL
)

func NewLevel

func NewLevel(level string) Level

func (Level) String

func (l Level) String() string

type LogEntry

type LogEntry struct {
	Time     time.Time `json:"time,omitempty"`
	Level    Level     `json:"level,omitempty"`
	SrcFile  string    `json:"srcf,omitempty"`
	Line     int       `json:"line,omitempty"`
	FuncName string    `json:"func,omitempty"`
	Msg      string    `json:"msg,omitempty"`
	Marker   string    `json:"marker,omitempty"`
	Err      error     `json:"error,omitempty"`
	Fields   Fields    `json:"fields,omitempty"`
	UseLoc   bool      `json:"-"`
}

func NewLogEntry

func NewLogEntry() *LogEntry

func (*LogEntry) Copy

func (le *LogEntry) Copy() *LogEntry

type SimpleFormatter

type SimpleFormatter struct {
}

func NewSimpleFormatter

func NewSimpleFormatter() *SimpleFormatter

func (*SimpleFormatter) Format

func (sf *SimpleFormatter) Format(entry *LogEntry) *bufferpool.Buffer

Jump to

Keyboard shortcuts

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