logging

package
v0.0.0-...-80caa2b Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFilename = "mcvisor.log"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Console ConsoleConfig `json:"console"`
	File    *FileConfig   `json:"file,omitempty"`
}

func NewConfig

func NewConfig(baseDir string) *Config

func (*Config) CreateLogging

func (c *Config) CreateLogging() (handler log.Handler, minLevel log.Level, service suture.Service)

type ConsoleConfig

type ConsoleConfig log.Level

func (ConsoleConfig) CreateLogging

func (c ConsoleConfig) CreateLogging() (log.Handler, log.Level, suture.Service)

func (ConsoleConfig) MarshalJSON

func (c ConsoleConfig) MarshalJSON() ([]byte, error)

func (*ConsoleConfig) UnmarshalJSON

func (c *ConsoleConfig) UnmarshalJSON(data []byte) error

type FileConfig

type FileConfig struct {
	Disabled bool      `json:"disabled,omitempty"`
	Level    log.Level `json:"level"`
	*lumberjack.Logger
	// contains filtered or unexported fields
}

func NewFileConfig

func NewFileConfig(baseDir string) *FileConfig

func (*FileConfig) CreateLogging

func (f *FileConfig) CreateLogging() (log.Handler, log.Level, suture.Service)

func (*FileConfig) HandleLog

func (f *FileConfig) HandleLog(entry *log.Entry) error

func (*FileConfig) Serve

func (f *FileConfig) Serve(ctx context.Context) (err error)

func (*FileConfig) WriteEntry

func (f *FileConfig) WriteEntry(writer io.Writer, entry *log.Entry) (err error)

Jump to

Keyboard shortcuts

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