logger

package
v0.6.3-beta01 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugLevel = iota
	InfoLevel
	WarningLevel
	ErrorLevel
)

Variables

This section is empty.

Functions

func Debug

func Debug() *log.Logger

func Error

func Error() *log.Logger

func Info

func Info() *log.Logger

func SetupGlobalLoger

func SetupGlobalLoger(controller io.Writer, level int, writers ...io.Writer)

func Warning

func Warning() *log.Logger

Types

type Logger

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

func New

func New(controller io.Writer, level int, w ...io.Writer) *Logger

Yes this API is not perfect. But I made controller Writer the first parameter So this way compiler will catch parameter errors at compile time. In a perfect world it would be best to detect controllerWriter inside But this leads to circular dependencies. Hope to find a more pretty solution one day.

func (*Logger) Debug

func (lgr *Logger) Debug() *log.Logger

func (*Logger) Error

func (lgr *Logger) Error() *log.Logger

func (*Logger) Info

func (lgr *Logger) Info() *log.Logger

func (*Logger) Warning

func (lgr *Logger) Warning() *log.Logger

Jump to

Keyboard shortcuts

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