Documentation
¶
Overview ¶
* @Author: NyanCatda * @Date: 2022-03-21 19:51:14 * @LastEditTime: 2022-06-17 23:41:24 * @LastEditors: NyanCatda * @Description: 终端输出颜色 * @FilePath: \Momizi\Tools\Log\Color.go
Index ¶
- Constants
- Variables
- func Black(msg string) string
- func Blue(msg string) string
- func Cyan(msg string) string
- func DeBug(Source string, Text ...any)
- func DelColor(msg string) string
- func Error(Source string, Error error)
- func Green(msg string) string
- func Info(Source string, Text ...any)
- func LogFile() (*os.File, error)
- func Magenta(msg string) string
- func Print(Source string, Level int, Text ...any) error
- func ReceivedMessage(ChatSoftware string, ChatType string, ChatID string, UserName string, ...)
- func Red(msg string) string
- func SendMessage(ChatSoftware string, ChatType string, ChatID string, Content string)
- func SetColor(msg string, conf, bg, text int) string
- func Warning(Source string, Text ...any)
- func White(msg string) string
- func Yellow(msg string) string
Constants ¶
View Source
const ( TextBlack = iota + 30 TextRed TextGreen TextYellow TextBlue TextMagenta TextCyan TextWhite )
View Source
const ( DEBUG = iota + 0 INFO WARNING ERROR OFF )
Variables ¶
View Source
var ( LogPath = Controller.LogPath + "/" LogLevel = DEBUG ColorPrint bool )
Functions ¶
func DeBug ¶
*
- @description: 打印DeBug错误
- @param {string} Source 日志来源
- @param {...any} Text 日志内容
- @return {*}
func Print ¶
*
- @description: 标准日志打印
- @param {string} Source 日志来源
- @param {string} Level 日志等级 INFO/WARNING/ERROR/DEBUG
- @param {...any} Text 日志内容
- @return {*}
func ReceivedMessage ¶
func ReceivedMessage(ChatSoftware string, ChatType string, ChatID string, UserName string, SenderID string, Content string)
*
- @description: 打印接收到的消息
- @param {string} ChatSoftware 聊天软件, QQ/Telegram/Line
- @param {string} ChatType 聊天类型, User/Group/Other
- @param {string} ChatID 聊天ID
- @param {string} UserName 用户名
- @param {string} SenderID 发送者ID
- @param {string} Content 消息内容
- @return {*}
func SendMessage ¶
*
- @description: 打印发送的消息
- @param {string} ChatSoftware 聊天软件, QQ/Telegram/Line
- @param {string} ChatType 聊天类型, User/Group/Other
- @param {string} ChatID 聊天ID
- @param {string} Content 消息内容
- @return {*}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.