log

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDepth int = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configure

type Configure struct {
	types.AutoConfigure `prefix:"application.logging"`
	Level               string     `json:"level" yaml:"level"`
	Adapter             string     `json:"adapter" yaml:"adapter"`
	SkipIndex           int        `json:"skip_index" yaml:"skip_index"`
	Style               *Style     `json:"style" yaml:"style"`
	Loggers             []*Loggers `json:"loggers" yaml:"loggers"`
}

type Level

type Level int
const (
	Trace Level = iota
	Debug
	Info
	Warn
	Error
	Panic
	Fatal
)

func (Level) String

func (l Level) String() string

type Logger

type Logger interface {
	bean.Bean
	Context(ctx context.Context) Logger
	GetName() string
	Trace(format string, a ...interface{})
	Debug(format string, a ...interface{})
	Info(format string, a ...interface{})
	Warn(format string, a ...interface{})
	Error(format string, a ...interface{})
	Panic(format string, a ...interface{})
	Fatal(format string, a ...interface{})
}

func New

func New(loggerAdapter LoggerAdapter, level Level, conf *Configure, depth int) (Logger, error)

type LoggerAdapter

type LoggerAdapter interface {
	bean.Bean
	Trace(a string, meta *Meta)
	Debug(a string, meta *Meta)
	Info(a string, meta *Meta)
	Warn(a string, meta *Meta)
	Error(a string, meta *Meta)
	Panic(a string, meta *Meta)
	Fatal(a string, meta *Meta)
}

type LoggerFactoryAdapter added in v1.4.4

type LoggerFactoryAdapter interface {
	GetLogger() (Logger, error)
}

func NewLoggerFactory added in v1.4.4

func NewLoggerFactory() LoggerFactoryAdapter

type Loggers added in v1.3.8

type Loggers struct {
	Name  string `json:"name" yaml:"name"`
	Level string `json:"level" yaml:"level"`
}

type Meta added in v1.3.8

type Meta struct {
	Ctx       context.Context
	Frame     *runtime.Frame
	Level     Level
	Timestamp time.Time
}

type Spec

type Spec struct {
	Layout string `json:"layout" yaml:"layout"`
	Color  int
}

type Style added in v1.3.8

type Style struct {
	Spec     map[string]*Spec `json:"spec" yaml:"spec"`
	Template []string         `json:"template" yaml:"template"`
}

Jump to

Keyboard shortcuts

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