xlog

package
Version: v1.0.20 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Reset = ColorType([]byte{27, 91, 48, 109})
	// 标准
	White   = ColorType([]byte{27, 91, 51, 48, 109}) // 白色
	Red     = ColorType([]byte{27, 91, 51, 49, 109}) // 红色
	Green   = ColorType([]byte{27, 91, 51, 50, 109}) // 绿色
	Yellow  = ColorType([]byte{27, 91, 51, 51, 109}) // 黄色
	Blue    = ColorType([]byte{27, 91, 51, 52, 109}) // 蓝色
	Magenta = ColorType([]byte{27, 91, 51, 53, 109}) // 紫色
	Cyan    = ColorType([]byte{27, 91, 51, 54, 109}) // 青色
	// 高亮
	WhiteBright   = ColorType([]byte{27, 91, 49, 59, 51, 48, 109})
	RedBright     = ColorType([]byte{27, 91, 49, 59, 51, 49, 109})
	GreenBright   = ColorType([]byte{27, 91, 49, 59, 51, 50, 109})
	YellowBright  = ColorType([]byte{27, 91, 49, 59, 51, 51, 109})
	BlueBright    = ColorType([]byte{27, 91, 49, 59, 51, 52, 109})
	MagentaBright = ColorType([]byte{27, 91, 49, 59, 51, 53, 109})
	CyanBright    = ColorType([]byte{27, 91, 49, 59, 51, 54, 109})
	// 斜体
	WhiteBevel   = ColorType([]byte{27, 91, 51, 59, 51, 48, 109})
	RedBevel     = ColorType([]byte{27, 91, 51, 59, 51, 49, 109})
	GreenBevel   = ColorType([]byte{27, 91, 51, 59, 51, 50, 109})
	YellowBevel  = ColorType([]byte{27, 91, 51, 59, 51, 51, 109})
	BlueBevel    = ColorType([]byte{27, 91, 51, 59, 51, 52, 109})
	MagentaBevel = ColorType([]byte{27, 91, 51, 59, 51, 53, 109})
	CyanBevel    = ColorType([]byte{27, 91, 51, 59, 51, 54, 109})
	// 下划线
	WhiteUnderLine   = ColorType([]byte{27, 91, 52, 59, 51, 48, 109})
	RedUnderLine     = ColorType([]byte{27, 91, 52, 59, 51, 49, 109})
	GreenUnderLine   = ColorType([]byte{27, 91, 52, 59, 51, 50, 109})
	YellowUnderLine  = ColorType([]byte{27, 91, 52, 59, 51, 51, 109})
	BlueUnderLine    = ColorType([]byte{27, 91, 52, 59, 51, 52, 109})
	MagentaUnderLine = ColorType([]byte{27, 91, 52, 59, 51, 53, 109})
	CyanUnderLine    = ColorType([]byte{27, 91, 52, 59, 51, 54, 109})
	// 背景色
	WhiteBg   = ColorType([]byte{27, 91, 55, 59, 51, 48, 109})
	RedBg     = ColorType([]byte{27, 91, 55, 59, 51, 49, 109})
	GreenBg   = ColorType([]byte{27, 91, 55, 59, 51, 50, 109})
	YellowBg  = ColorType([]byte{27, 91, 55, 59, 51, 51, 109})
	BlueBg    = ColorType([]byte{27, 91, 55, 59, 51, 52, 109})
	MagentaBg = ColorType([]byte{27, 91, 55, 59, 51, 53, 109})
	CyanBg    = ColorType([]byte{27, 91, 55, 59, 51, 54, 109})
	// 删除线
	WhiteDelLine   = ColorType([]byte{27, 91, 57, 59, 51, 48, 109})
	RedDelLine     = ColorType([]byte{27, 91, 57, 59, 51, 49, 109})
	GreenDelLine   = ColorType([]byte{27, 91, 57, 59, 51, 50, 109})
	YellowDelLine  = ColorType([]byte{27, 91, 57, 59, 51, 51, 109})
	BlueDelLine    = ColorType([]byte{27, 91, 57, 59, 51, 52, 109})
	MagentaDelLine = ColorType([]byte{27, 91, 57, 59, 51, 53, 109})
	CyanDelLine    = ColorType([]byte{27, 91, 57, 59, 51, 54, 109})
)

Functions

func Debug

func Debug(args ...interface{})

func Debugf

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

func Error

func Error(args ...interface{})

func Errorf

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

func Info

func Info(args ...interface{})

func Infof

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

func Warn added in v1.0.7

func Warn(args ...interface{})

func Warnf added in v1.0.7

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

Types

type ColorLogger added in v1.0.11

type ColorLogger struct {
	Color ColorType
	// contains filtered or unexported fields
}

func Color added in v1.0.11

func Color(color ColorType) *ColorLogger

func (*ColorLogger) Debug added in v1.0.11

func (l *ColorLogger) Debug(args ...interface{})

func (*ColorLogger) Debugf added in v1.0.11

func (l *ColorLogger) Debugf(format string, args ...interface{})

func (*ColorLogger) Error added in v1.0.11

func (l *ColorLogger) Error(args ...interface{})

func (*ColorLogger) Errorf added in v1.0.11

func (l *ColorLogger) Errorf(format string, args ...interface{})

func (*ColorLogger) Info added in v1.0.11

func (l *ColorLogger) Info(args ...interface{})

func (*ColorLogger) Infof added in v1.0.11

func (l *ColorLogger) Infof(format string, args ...interface{})

func (*ColorLogger) Warn added in v1.0.11

func (l *ColorLogger) Warn(args ...interface{})

func (*ColorLogger) Warnf added in v1.0.11

func (l *ColorLogger) Warnf(format string, args ...interface{})

type ColorType added in v1.0.11

type ColorType string

type DebugLogger

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

type ErrorLogger

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

type InfoLogger

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

type WarnLogger added in v1.0.7

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

type ZapLogger added in v1.0.11

type ZapLogger struct {
	Logger *zap.Logger
	Sugar  *zap.SugaredLogger
	// contains filtered or unexported fields
}

func Zap added in v1.0.7

func Zap() *ZapLogger

func (*ZapLogger) Debug added in v1.0.11

func (l *ZapLogger) Debug(args ...interface{})

func (*ZapLogger) Debugf added in v1.0.11

func (l *ZapLogger) Debugf(format string, args ...interface{})

func (*ZapLogger) Error added in v1.0.11

func (l *ZapLogger) Error(args ...interface{})

func (*ZapLogger) Errorf added in v1.0.11

func (l *ZapLogger) Errorf(format string, args ...interface{})

func (*ZapLogger) Info added in v1.0.11

func (l *ZapLogger) Info(args ...interface{})

func (*ZapLogger) Infof added in v1.0.11

func (l *ZapLogger) Infof(format string, args ...interface{})

func (*ZapLogger) Warn added in v1.0.11

func (l *ZapLogger) Warn(args ...interface{})

func (*ZapLogger) Warnf added in v1.0.11

func (l *ZapLogger) Warnf(format string, args ...interface{})

Jump to

Keyboard shortcuts

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