log

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidLogType = errors.New("invalid log type")

ErrInvalidLogType is error for invalid log type.

Functions

func New

func New(cfg Config) (log.Logger, error)

New to create new log client depends on the type. Color will not work in json format.

Types

type Config

type Config struct {
	Type       LogType
	Level      LogLevel
	JsonFormat bool
	Color      bool

	// For newrelic.
	NewrelicName    string
	NewrelicLicense string
}

Config is log config.

type LogLevel

type LogLevel int8

LogLevel is level of log that will be printed. Will print level that is higher than your chosen one.

const (
	TraceLevel LogLevel = iota - 1
	DebugLevel
	InfoLevel
	WarnLevel
	ErrorLevel
	FatalLevel
	PanicLevel
	Disabled
)

Available log level.

type LogType

type LogType int8

LogType is type for logging library.

const (
	NOP LogType = iota
	Zerolog
	Newrelic
)

Available types for logging.

Jump to

Keyboard shortcuts

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