Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设置日志颜色,支持只设置 tag,不设置日志内容颜色 #145

Open
craterone opened this issue May 17, 2024 · 3 comments
Open
Assignees
Labels
question Further information is requested

Comments

@craterone
Copy link

设置之前:
${{\color{Green}\Huge{\textsf{ [INFO] }}}}$ |2024-05-17 16:22:43.458| (/root/signal-server/libs/ws_server.go:244) ${{\color{Green}\Huge{\textsf{ New connection }}}}$

设置之后:
${{\color{Green}\Huge{\textsf{ [INFO] }}}}$ |2024-05-17 16:22:43.458| (/root/signal-server/libs/ws_server.go:244) New connection

@inhere
Copy link
Member

inhere commented May 17, 2024

怎么创建log 和 配置的呢

@inhere inhere added the question Further information is requested label May 17, 2024
@craterone
Copy link
Author

不是bug, 是想看看能否加个feature。我们其他项目用的大部分都是 log4 一类的日志库,这些库设置颜色时候,日志内容本身都没设置颜色。内容有时候要解析,加颜色有时候会有影响。

@inhere
Copy link
Member

inhere commented Jun 3, 2024

日志内容可以用 file handler 写入文件。只有 consoleHandler 是设置了颜色处理的,其他的都是不添加 颜色tag的。也可以设置 textFormatter 禁用颜色。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants