logger

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2023 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LogFilename = "pactus.log"
	MaxLogSize  = 10 // 10MB to rotate a log file
)

Functions

func Debug

func Debug(msg string, keyvals ...interface{})

func Error

func Error(msg string, keyvals ...interface{})

func Fatal

func Fatal(msg string, keyvals ...interface{})

func Info

func Info(msg string, keyvals ...interface{})

func InitGlobalLogger added in v0.15.0

func InitGlobalLogger(conf *Config)

func Panic

func Panic(msg string, keyvals ...interface{})

func Trace

func Trace(msg string, keyvals ...interface{})

func Warn

func Warn(msg string, keyvals ...interface{})

Types

type Config

type Config struct {
	Colorful bool              `toml:"colorful"`
	Levels   map[string]string `toml:"levels"`
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) BasicCheck added in v0.15.0

func (conf *Config) BasicCheck() error

BasicCheck performs basic checks on the configuration.

type ShortStringer added in v0.15.0

type ShortStringer interface {
	ShortString() string
}

type SubLogger added in v0.15.0

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

func NewSubLogger added in v0.15.0

func NewSubLogger(name string, obj fmt.Stringer) *SubLogger

func (*SubLogger) Debug added in v0.15.0

func (sl *SubLogger) Debug(msg string, keyvals ...interface{})

func (*SubLogger) Error added in v0.15.0

func (sl *SubLogger) Error(msg string, keyvals ...interface{})

func (*SubLogger) Fatal added in v0.15.0

func (sl *SubLogger) Fatal(msg string, keyvals ...interface{})

func (*SubLogger) Info added in v0.15.0

func (sl *SubLogger) Info(msg string, keyvals ...interface{})

func (*SubLogger) Panic added in v0.15.0

func (sl *SubLogger) Panic(msg string, keyvals ...interface{})

func (*SubLogger) Trace added in v0.15.0

func (sl *SubLogger) Trace(msg string, keyvals ...interface{})

func (*SubLogger) Warn added in v0.15.0

func (sl *SubLogger) Warn(msg string, keyvals ...interface{})

Jump to

Keyboard shortcuts

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