logger

package
v0.0.0-...-16fe120 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(log Log)

func Debug

func Debug(v interface{})

func Error

func Error(v interface{})

func Fatal

func Fatal(v interface{})

func Info

func Info(v interface{})

func Initialize

func Initialize(v string) error

func Warn

func Warn(v interface{})

Types

type Level

type Level uint
const (
	LevelUnknown Level = iota
	LevelFatal
	LevelError
	LevelWarn
	LevelInfo
	LevelDebug
)

func ParseLevel

func ParseLevel(v string) Level

type Log

type Log interface {
	IsLog(level Level) bool
	Log(v string) error
}

type LogConsole

type LogConsole struct {
	Level  Level
	Writer io.Writer
}

func NewLogConsole

func NewLogConsole(level Level, writer io.Writer) *LogConsole

func (*LogConsole) IsLog

func (l *LogConsole) IsLog(level Level) bool

func (*LogConsole) Log

func (l *LogConsole) Log(v string) error

type LogFile

type LogFile struct {
	Level Level
	File  *os.File
}

func NewLogFile

func NewLogFile(level Level, file *os.File) *LogFile

func (*LogFile) Close

func (l *LogFile) Close() error

func (*LogFile) IsLog

func (l *LogFile) IsLog(level Level) bool

func (*LogFile) Log

func (l *LogFile) Log(v string) error

type Type

type Type uint
const (
	TypeUnknown Type = iota
	TypeNone
	TypeStandardOut
	TypeStandardError
	TypeFile
)

func ParseType

func ParseType(v string) Type

Jump to

Keyboard shortcuts

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