logger

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvNameLevel  string = "BLUDGEON_LOG_LEVEL"
	EnvNamePrefix string = "BLUDGEON_LOG_PREFIX"
)

Variables

This section is empty.

Functions

func New

func New() interface {
	Logger
	Printer
	internal.Configurer
}

func NewNullLogger added in v1.3.1

func NewNullLogger(parameters ...interface{}) interface {
	Logger
	Printer
}

Types

type Configuration added in v1.2.0

type Configuration struct {
	Level  Level  `json:"level"`
	Prefix string `json:"prefix"`
}

func (*Configuration) Default added in v1.2.0

func (c *Configuration) Default()

func (*Configuration) FromEnv added in v1.2.0

func (c *Configuration) FromEnv(envs map[string]string)

type Level added in v1.2.0

type Level int
const (
	Error Level = 1
	Info  Level = 2
	Debug Level = 3
	Trace Level = 4
)
const (
	DefaultLevel Level = Info
)

func AtoLogLevel added in v1.2.0

func AtoLogLevel(a string) Level

func (Level) String added in v1.2.0

func (l Level) String() string

type Logger

type Logger interface {
	Error(format string, v ...interface{})
	Info(format string, v ...interface{})
	Debug(format string, v ...interface{})
	Trace(format string, v ...interface{})
}

type Printer added in v1.2.1

type Printer interface {
	Print(v ...interface{})
	Printf(format string, v ...interface{})
	Println(v ...interface{})
}

Jump to

Keyboard shortcuts

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