log

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: MIT Imports: 9 Imported by: 82

Documentation

Index

Constants

View Source
const (
	Red    = "1;31"
	Green  = "1;32"
	Yellow = "1;33"
	Pink   = "1;35"
	Cyan   = "1;36"
)

Variables

View Source
var (
	Stdout = os.Stdout
)

Functions

func Color

func Color(code, msg string) string

func Debug

func Debug(a ...interface{})

func Debugf

func Debugf(format string, a ...interface{})

func Error

func Error(a ...interface{})

func Errorf

func Errorf(format string, a ...interface{})

func Fatal

func Fatal(a ...interface{})

func Fatalf

func Fatalf(format string, a ...interface{})

func Info

func Info(a ...interface{})

func Infof

func Infof(format string, a ...interface{})

func SetPrintLevel added in v0.2.2

func SetPrintLevel(level uint8)

func Warn

func Warn(a ...interface{})

func Warnf

func Warnf(format string, a ...interface{})

Types

type Logger

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

func NewDefault added in v0.3.0

func NewDefault(path string, level uint8, maxPerLogSizeMb, maxLogsSizeMb int64) *Logger

func NewFileLogger added in v0.5.0

func NewFileLogger(outputPath string, level uint8, maxPerLogSizeMb,
	maxLogsSizeMb int64) *Logger

func NewLogger added in v0.2.2

func NewLogger(outputPath string, level uint8, maxPerLogSizeMb,
	maxLogsSizeMb int64) *Logger

func (*Logger) Debug

func (l *Logger) Debug(a ...interface{})

func (*Logger) Debugf

func (l *Logger) Debugf(format string, a ...interface{})

func (*Logger) Error

func (l *Logger) Error(a ...interface{})

func (*Logger) Errorf

func (l *Logger) Errorf(format string, a ...interface{})

func (*Logger) Fatal

func (l *Logger) Fatal(a ...interface{})

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, a ...interface{})

func (*Logger) Info

func (l *Logger) Info(a ...interface{})

func (*Logger) Infof

func (l *Logger) Infof(format string, a ...interface{})

func (*Logger) Level added in v0.2.2

func (l *Logger) Level() elalog.Level

Level returns the current logging level.

func (*Logger) Output

func (l *Logger) Output(level uint8, a ...interface{})

func (*Logger) Outputf

func (l *Logger) Outputf(level uint8, format string, v ...interface{})

func (*Logger) SetLevel added in v0.2.2

func (l *Logger) SetLevel(level elalog.Level)

SetLevel changes the logging level to the passed level.

func (*Logger) Warn

func (l *Logger) Warn(a ...interface{})

func (*Logger) Warnf

func (l *Logger) Warnf(format string, a ...interface{})

func (*Logger) Writer added in v0.3.0

func (l *Logger) Writer() io.Writer

Jump to

Keyboard shortcuts

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