log

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 3 Imported by: 257

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(a ...interface{})

func Error

func Error(a ...interface{})

func Info

func Info(a ...interface{})

func Output

func Output(a ...interface{})

func SetLogger

func SetLogger(newLogger Log)

func Warn

func Warn(a ...interface{})

Types

type LevelType

type LevelType int
const (
	ERROR LevelType = iota
	WARN
	INFO
	DEBUG
)

func GetLogLevel

func GetLogLevel() LevelType

type Log

type Log interface {
	GetLogLevel() LevelType
	SetLogLevel(LevelType)
	SetOutputWriter(writer io.Writer)
	SetLogsWriter(writer io.Writer)

	Debug(a ...interface{})
	Info(a ...interface{})
	Warn(a ...interface{})
	Error(a ...interface{})
	Output(a ...interface{})
}
var Logger Log

func NewLogger

func NewLogger(logLevel LevelType, logToWriter io.Writer) Log

Creates a new logger with a given LogLevel. All logs are written to Stderr by default (output to Stdout). If logToWriter != nil, logging is done to the provided writer instead.

Jump to

Keyboard shortcuts

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