logger

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlackAntiWhiteText

func BlackAntiWhiteText(v interface{}) string

func BlackBg

func BlackBg(v interface{}) string

func BlackBoldText

func BlackBoldText(v interface{}) string

func BlackFlashText

func BlackFlashText(v interface{}) string

func BlackText

func BlackText(v interface{}) string

func BlackUnderlineText

func BlackUnderlineText(v interface{}) string

func BlueAntiWhiteText

func BlueAntiWhiteText(v interface{}) string

func BlueBg

func BlueBg(v interface{}) string

func BlueBoldText

func BlueBoldText(v interface{}) string

func BlueFlashText

func BlueFlashText(v interface{}) string

func BlueText

func BlueText(v interface{}) string

func BlueUnderlineText

func BlueUnderlineText(v interface{}) string

func CyanAntiWhiteText

func CyanAntiWhiteText(v interface{}) string

func CyanBg

func CyanBg(v interface{}) string

func CyanBoldText

func CyanBoldText(v interface{}) string

func CyanFlashText

func CyanFlashText(v interface{}) string

func CyanText

func CyanText(v interface{}) string

func CyanUnderlineText

func CyanUnderlineText(v interface{}) string

func GreenAntiWhiteText

func GreenAntiWhiteText(v interface{}) string

func GreenBg

func GreenBg(v interface{}) string

func GreenBoldText

func GreenBoldText(v interface{}) string

func GreenFlashText

func GreenFlashText(v interface{}) string

func GreenText

func GreenText(v interface{}) string

func GreenUnderlineText

func GreenUnderlineText(v interface{}) string

func HttpLogger

func HttpLogger(lq *LogQueue, method string, path string, statusCode int, duration time.Duration, exMess ...string)

func NewLogCon

func NewLogCon(message ...interface{}) *logCon

func PurpleAntiWhiteText

func PurpleAntiWhiteText(v interface{}) string

func PurpleBg

func PurpleBg(v interface{}) string

func PurpleBoldText

func PurpleBoldText(v interface{}) string

func PurpleFlashText

func PurpleFlashText(v interface{}) string

func PurpleText

func PurpleText(v interface{}) string

func PurpleUnderlineText

func PurpleUnderlineText(v interface{}) string

func RedAntiWhiteText

func RedAntiWhiteText(v interface{}) string

func RedBg

func RedBg(v interface{}) string

func RedBoldText

func RedBoldText(v interface{}) string

func RedFlashText

func RedFlashText(v interface{}) string

func RedText

func RedText(v interface{}) string

func RedUnderlineText

func RedUnderlineText(v interface{}) string

func WhiteAntiWhiteText

func WhiteAntiWhiteText(v interface{}) string

func WhiteBg

func WhiteBg(v interface{}) string

func WhiteBoldText

func WhiteBoldText(v interface{}) string

func WhiteFlashText

func WhiteFlashText(v interface{}) string

func WhiteText

func WhiteText(v interface{}) string

func WhiteUnderlineText

func WhiteUnderlineText(v interface{}) string

func YellowAntiWhiteText

func YellowAntiWhiteText(v interface{}) string

func YellowBg

func YellowBg(v interface{}) string

func YellowBoldText

func YellowBoldText(v interface{}) string

func YellowFlashText

func YellowFlashText(v interface{}) string

func YellowText

func YellowText(v interface{}) string

func YellowUnderlineText

func YellowUnderlineText(v interface{}) string

Types

type LogQueue

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

添加日志队列

func NewLogger

func NewLogger() *LogQueue

func (*LogQueue) AddDestination

func (lq *LogQueue) AddDestination(dest ...int)

添加输出位置

func (*LogQueue) Console

func (lq *LogQueue) Console(lc *logCon)

可以自定义输出颜色,输出前缀

func (*LogQueue) DEBUG

func (lq *LogQueue) DEBUG(message ...interface{}) (*logCon, error)

func (*LogQueue) DestExist

func (lq *LogQueue) DestExist(key int) bool

判断某一输出状态是否存在

func (*LogQueue) DoLogQueue

func (lq *LogQueue) DoLogQueue()

func (*LogQueue) ERROR

func (lq *LogQueue) ERROR(message ...interface{})

func (*LogQueue) FATAL

func (lq *LogQueue) FATAL(message ...interface{})

func (*LogQueue) GetDestination

func (lq *LogQueue) GetDestination() []int

获取输出位置

func (*LogQueue) INFO

func (lq *LogQueue) INFO(message ...interface{})

func (*LogQueue) PANIC

func (lq *LogQueue) PANIC(message ...interface{}) (*logCon, error)

不会真实调用panic,需要请直接panic,但是不会记录日志文件

func (*LogQueue) RemoveDestination

func (lq *LogQueue) RemoveDestination(key int)

移除某一输出

func (*LogQueue) SendMail

func (lq *LogQueue) SendMail(mess *FlyWhisper.Message) error

func (*LogQueue) SetDestination

func (lq *LogQueue) SetDestination(dest ...int)

设置输出位置logOutWay

func (*LogQueue) SetErrLogOut

func (lq *LogQueue) SetErrLogOut(out io.Writer)

func (*LogQueue) SetLevel

func (lq *LogQueue) SetLevel(level int)

func (*LogQueue) SetLogFileMaxSize

func (lq *LogQueue) SetLogFileMaxSize(size int64)

设置日志文件大小上线

func (*LogQueue) SetLogOut

func (lq *LogQueue) SetLogOut(out io.Writer)

func (*LogQueue) SetLogOutPath

func (lq *LogQueue) SetLogOutPath(filename string) error

设置输出到日志文件 默认输出到服务的当前目录 如果filename已存在并且为文件夹,则会往里添加文件 如果filename已存在但是是一个文件,则会在同级目录下生成日志文件 新建一个名为filename的文件夹 日志文件创建失败,会将日志转移至os.Stdout

func (*LogQueue) SmtpLogger

func (lq *LogQueue) SmtpLogger(username string, password string, host string, port string, from string) *FlyWhisper.SMTPSender

func (*LogQueue) WARNING

func (lq *LogQueue) WARNING(message ...interface{})

Jump to

Keyboard shortcuts

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