xseelog

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: MIT Imports: 9 Imported by: 0

README

xseelog

seelog contrib package. Includes config, XML-free configuraation. Multiple loggers.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromLogLevel

func FromLogLevel(lvl log.Level) seelog.LogLevel

impl From<log.Level> for seelog.LogLevel

Types

type Config

type Config struct {
	Dir string `yaml:"dir"`

	DisableConsole bool `yaml:"disable-console"`
	DisableFile    bool `yaml:"disable-file"`

	Logs map[string]*ConfigLogger `yaml:"loggers"`
}

func NewConfig

func NewConfig() *Config

func (*Config) Dump

func (c *Config) Dump(ctx *dumpctx.Ctx, w io.Writer)

func (*Config) Ensure

func (c *Config) Ensure(name, prefix string, min, max log.Level)

func (*Config) Loggers

func (c *Config) Loggers() (*Loggers, error)

func (*Config) Quiet

func (c *Config) Quiet()

func (*Config) VV

func (c *Config) VV()

func (*Config) VVV

func (c *Config) VVV()

type ConfigLogger

type ConfigLogger struct {
	Prefix string `yaml:"prefix"`

	FileInfo  string `yaml:"file-info"`
	FileError string `yaml:"file-error"`

	LevelMin log.Level `yaml:"level-min"`
	LevelMax log.Level `yaml:"level-max"`
}

func (*ConfigLogger) Dump

func (cl *ConfigLogger) Dump(ctx *dumpctx.Ctx, w io.Writer)

type Loggers

type Loggers struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewLoggers

func NewLoggers() *Loggers

func (*Loggers) ByName

func (l *Loggers) ByName(name string) interface{}

impl log.Loggers for Loggers

func (*Loggers) Close

func (l *Loggers) Close()

func (*Loggers) Logger

func (l *Loggers) Logger(name string) seelog.LoggerInterface

func (*Loggers) ReplaceRoot

func (l *Loggers) ReplaceRoot()

Jump to

Keyboard shortcuts

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