log

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelFatal = iota
	LevelError
	LevelWarning
	LevelInfo
	LevelDebug
)

Variables

This section is empty.

Functions

func AddOutput

func AddOutput(w io.Writer)

func Debug

func Debug(s string) error

func Debugf

func Debugf(format string, v ...interface{}) error

func EnableAnsiColor

func EnableAnsiColor(enable bool)

func Error

func Error(s string) error

func Errorf

func Errorf(format string, v ...interface{}) error

func Fatal

func Fatal(s string)

func Fatalf

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

func Info

func Info(s string) error

func Infof

func Infof(format string, v ...interface{}) error

func New

func New() *logger

New 实例化,供外部直接调用 log.XXXX

func NewLogger

func NewLogger() *logger

NewLogger 实例化,供自定义

func SetLogLevel

func SetLogLevel(level Level)

func SetOutput

func SetOutput(w io.Writer)

func SetPrefix

func SetPrefix(prefix string)

func Warn

func Warn(s string) error

func Warnf

func Warnf(format string, v ...interface{}) error

Types

type Level

type Level int

Jump to

Keyboard shortcuts

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