xlog

package
v0.0.0-...-95cb943 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

README

xlog

log lib

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Reset = &reset
	// 标准
	White   = &white
	Red     = &red
	Green   = &green
	Yellow  = &yellow
	Blue    = &blue
	Magenta = &magenta
	Cyan    = &cyan
	// 高亮
	WhiteBright   = &whiteBright
	RedBright     = &redBright
	GreenBright   = &greenBright
	YellowBright  = &yellowBright
	BlueBright    = &blueBright
	MagentaBright = &magentaBright
	CyanBright    = &cyanBright
	// 斜体
	WhiteBevel   = &whiteBevel
	RedBevel     = &redBevel
	GreenBevel   = &greenBevel
	YellowBevel  = &yellowBevel
	BlueBevel    = &blueBevel
	MagentaBevel = &magentaBevel
	CyanBevel    = &cyanBevel
	// 下划线
	WhiteUnderLine   = &whiteUnderLine
	RedUnderLine     = &redUnderLine
	GreenUnderLine   = &greenUnderLine
	YellowUnderLine  = &yellowUnderLine
	BlueUnderLine    = &blueUnderLine
	MagentaUnderLine = &magentaUnderLine
	CyanUnderLine    = &cyanUnderLine
	// 背景色
	WhiteBg   = &whiteBg
	RedBg     = &redBg
	GreenBg   = &greenBg
	YellowBg  = &yellowBg
	BlueBg    = &blueBg
	MagentaBg = &magentaBg
	CyanBg    = &cyanBg
	// 删除线
	WhiteDelLine   = &whiteDelLine
	RedDelLine     = &redDelLine
	GreenDelLine   = &greenDelLine
	YellowDelLine  = &yellowDelLine
	BlueDelLine    = &blueDelLine
	MagentaDelLine = &magentaDelLine
	CyanDelLine    = &cyanDelLine
)

Functions

func Debug

func Debug(args ...any)

青色:Cyan

func Debugf

func Debugf(format string, args ...any)

青色:Cyan

func Error

func Error(args ...any)

红色:Red

func Errorf

func Errorf(format string, args ...any)

红色:Red

func Info

func Info(args ...any)

白色:White

func Infof

func Infof(format string, args ...any)

白色:White

func SetColorful

func SetColorful(colorful bool)

func SetLevel

func SetLevel(level LogLevel)

func Warn

func Warn(args ...any)

黄色:Yellow

func Warnf

func Warnf(format string, args ...any)

黄色:Yellow

Types

type ColorType

type ColorType string

type LogLevel

type LogLevel int
const (
	ErrorLevel LogLevel = iota + 1
	WarnLevel
	InfoLevel
	DebugLevel
)

type Logger

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

func NewLogger

func NewLogger() *Logger

func (*Logger) Color

func (l *Logger) Color(col *ColorType)

func (*Logger) Colorful

func (l *Logger) Colorful(colorful bool)

func (*Logger) Debug

func (l *Logger) Debug(args ...any)

func (*Logger) Debugf

func (l *Logger) Debugf(fmt string, args ...any)

func (*Logger) Error

func (l *Logger) Error(args ...any)

func (*Logger) Errorf

func (l *Logger) Errorf(fmt string, args ...any)

func (*Logger) Info

func (l *Logger) Info(args ...any)

func (*Logger) Infof

func (l *Logger) Infof(fmt string, args ...any)

func (*Logger) SetLevel

func (l *Logger) SetLevel(level LogLevel)

func (*Logger) Warn

func (l *Logger) Warn(args ...any)

func (*Logger) Warnf

func (l *Logger) Warnf(fmt string, args ...any)

type XLogger

type XLogger interface {
	Debug(args ...any)
	Info(args ...any)
	Warn(args ...any)
	Error(args ...any)

	Debugf(fmt string, args ...any)
	Infof(fmt string, args ...any)
	Warnf(fmt string, args ...any)
	Errorf(fmt string, args ...any)
}

Jump to

Keyboard shortcuts

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