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

Log 貌似还不支持非JSON格式的? #7

Closed
chf007 opened this issue Aug 28, 2020 · 2 comments
Closed

Log 貌似还不支持非JSON格式的? #7

chf007 opened this issue Aug 28, 2020 · 2 comments

Comments

@chf007
Copy link

chf007 commented Aug 28, 2020

log:
  log_format_text: true           # 日志的输出格式,json或者plaintext,true会输出成plaintext格式,false会输出成json格式

plaintext 没有生效,看代码也只有 JSON 的 NewJSONEncoder

@qloog
Copy link
Contributor

qloog commented Aug 29, 2020

@chf007 嗯,这块之前是用的其它库,后来替换为 zap, 目前只实现了json格式,zap暂时还不支持plaintext的,所以也没加上。当然如果有需要使用 plaintext,也可以自己实现 zapcore.Encoder 接口来做。

目前来看使用json格式基本满足日常使用。

@chf007
Copy link
Author

chf007 commented Aug 30, 2020

好的,明白了

@chf007 chf007 closed this as completed Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants