Documentation ¶
Index ¶
- func ColorPrint(str string, mode ColorPrintMode, bc PrintColor, tc PrintColor)
- func NewBaseLogger(writer GLogWriterGetter, options *GLogOptions) *baseLogger
- type ColorPrintMode
- type GLog
- type GLogOptions
- type GLogWriter
- type GLogWriterGetter
- type GLogger
- type GWSLogWriter
- type GWSLogger
- type LogLevel
- type PrintColor
- type WSEventData
- type WSEventDataPk
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColorPrint ¶ added in v0.0.5
func ColorPrint(str string, mode ColorPrintMode, bc PrintColor, tc PrintColor)
func NewBaseLogger ¶
func NewBaseLogger(writer GLogWriterGetter, options *GLogOptions) *baseLogger
Types ¶
type ColorPrintMode ¶ added in v0.0.5
type ColorPrintMode int
const ( // ColorPrintModeDefault 终端默认设置 ColorPrintModeDefault ColorPrintMode = 0 // ColorPrintModeHighlight 高亮显示 ColorPrintModeHighlight ColorPrintMode = 1 // ColorPrintModeUnderline 使用下划线 ColorPrintModeUnderline ColorPrintMode = 4 // ColorPrintModeFlash 闪烁 ColorPrintModeFlash ColorPrintMode = 5 // ColorPrintModeReverse 反白 ColorPrintModeReverse ColorPrintMode = 7 // ColorPrintModeHidden 不可见 ColorPrintModeHidden ColorPrintMode = 8 )
type GLogOptions ¶
type GLogWriter ¶
type GLogWriter interface {
Write(log *GLog)
}
type GLogWriterGetter ¶
type GLogWriterGetter func() GLogWriter
type GLogger ¶
type GLogger interface { Log(level LogLevel, tag string, data any) Info(tag string, data any) Debug(tag string, data any) Warn(tag string, data any) Error(tag string, data any) }
func NewConsoleLogger ¶
func NewConsoleLogger(options *GLogOptions) GLogger
type GWSLogWriter ¶
type PrintColor ¶ added in v0.0.5
type PrintColor int
const ( // PrintTextColorBlack 黑色 PrintTextColorBlack PrintColor = 30 // PrintTextColorRed 红色 PrintTextColorRed PrintColor = 31 // PrintTextColorGreen 绿色 PrintTextColorGreen PrintColor = 32 // PrintTextColorYellow 黄色 PrintTextColorYellow PrintColor = 33 // PrintTextColorBlue 蓝色 PrintTextColorBlue PrintColor = 34 // PrintTextColorPurplishRed 紫红色 PrintTextColorPurplishRed PrintColor = 35 // PrintTextColorTurquoise 青蓝色 PrintTextColorTurquoise PrintColor = 36 // PrintTextColorWhite 白色 PrintTextColorWhite PrintColor = 37 // PrintBackgroundBlack 色黑 PrintBackgroundBlack PrintColor = 40 // PrintBackgroundRed 红色 PrintBackgroundRed PrintColor = 41 // PrintBackgroundGreen 绿色 PrintBackgroundGreen PrintColor = 42 // PrintBackgroundYellow 黄色 PrintBackgroundYellow PrintColor = 43 // PrintBackgroundBlue 蓝色 PrintBackgroundBlue PrintColor = 44 // PrintBackgroundPurplishRed 紫红色 PrintBackgroundPurplishRed PrintColor = 35 // PrintBackgroundTurquoise 青蓝色 PrintBackgroundTurquoise PrintColor = 46 // PrintBackgroundWhite 白色 PrintBackgroundWhite PrintColor = 47 )
type WSEventData ¶
type WSEventData struct { Code int `json:"code"` Msg string `json:"msg"` Content any `json:"content,omitempty"` }
func NewEventError ¶
func NewEventError(msg string) *WSEventData
func NewWSEventData ¶
func NewWSEventData(data any) *WSEventData
type WSEventDataPk ¶
Click to show internal directories.
Click to hide internal directories.