logging

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseLogger

type BaseLogger interface {
	IsEnabled(logLevel LogLevel) bool
	Log(logLevel LogLevel, msg string)
}

func NewConsoleLogger

func NewConsoleLogger(options LoggerOptions) BaseLogger

type ChainedLogger

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

func (*ChainedLogger) Debug

func (logger *ChainedLogger) Debug(msg string, args ...interface{})

func (*ChainedLogger) Error

func (logger *ChainedLogger) Error(msg string, args ...interface{})

func (*ChainedLogger) Fatal

func (logger *ChainedLogger) Fatal(msg string, args ...interface{})

func (*ChainedLogger) Info

func (logger *ChainedLogger) Info(msg string, args ...interface{})

func (*ChainedLogger) IsEnabled

func (logger *ChainedLogger) IsEnabled(logLevel LogLevel) bool

func (*ChainedLogger) Warning

func (logger *ChainedLogger) Warning(msg string, args ...interface{})

type LogLevel

type LogLevel int
const (
	DEBUG_LEVEL LogLevel = iota
	INFO_LEVEL
	WARNING_LEVEL
	ERROR_LEVEL
	FATAL_LEVEL
	NONE_LEVEL
)

func (LogLevel) String

func (logLevel LogLevel) String() string

type Logger

type Logger interface {
	Debug(msg string, args ...interface{})
	Info(msg string, args ...interface{})
	Warning(msg string, args ...interface{})
	Error(msg string, args ...interface{})
	Fatal(msg string, args ...interface{})
}

func NewLoggerWrapper

func NewLoggerWrapper(loggers []BaseLogger) Logger

type LoggerOptions

type LoggerOptions struct {
	LogLevel LogLevel
	Prefix   string
	Flags    int
}

Jump to

Keyboard shortcuts

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