log

package
v0.0.0-...-47e6888 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TextBlack = iota + 30
	TextRed
	TextGreen
	TextYellow
	TextBlue
	TextMagenta
	TextCyan
	TextWhite
)
View Source
const Lshortfile = log.Lshortfile
View Source
const LstdFlags = log.LstdFlags

Variables

View Source
var NowFunc = func() time.Time {
	return time.Now()
}

Functions

func Black

func Black(msg string) string

func Blue

func Blue(msg string) string

func Close

func Close()

func Cyan

func Cyan(msg string) string

func Debug

func Debug(a ...interface{})

doPrint

func DebugCallDepth

func DebugCallDepth(callDepth int, a ...interface{})

func Debugf

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

doPrintf

func DebugfCallDepth

func DebugfCallDepth(callDepth int, format string, a ...interface{})

自定义调用层级输出文件名

func Error

func Error(a ...interface{})

func Errorf

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

func Export

func Export(logger *Logger)

It's dangerous to call the method on logging

func Fatal

func Fatal(a ...interface{})

func Fatalf

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

func Green

func Green(msg string) string

func Info

func Info(a ...interface{})

func Infof

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

func Magenta

func Magenta(msg string) string

func Red

func Red(msg string) string

func SetColor

func SetColor(msg string, conf, bg, text int) string

func SetMsgColor

func SetMsgColor(level int, msg string) string

func White

func White(msg string) string

func Yellow

func Yellow(msg string) string

Types

type Logger

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

func GetLogger

func GetLogger() *Logger

func New

func New(strLevel string, dir string, flag int, prefix string, logCompress bool, env string, fileNameSuffix string) (*Logger, error)

func (*Logger) Close

func (logger *Logger) Close()

It's dangerous to call the method on logging

func (*Logger) GetLevel

func (logger *Logger) GetLevel() int

func (*Logger) GetWriter

func (logger *Logger) GetWriter() io.Writer

func (*Logger) Print

func (logger *Logger) Print(v ...interface{})

func (*Logger) SetLevel

func (logger *Logger) SetLevel(strLevel string)

Jump to

Keyboard shortcuts

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