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

Feature: 日志记录自动检测终端是否支持彩色 #1034

Merged
merged 3 commits into from
Jun 3, 2022

Conversation

BlueGlassBlock
Copy link
Contributor

Decoding error may be raised when escape sequences couldn't be handled correctly.

@codecov
Copy link

codecov bot commented Jun 3, 2022

Codecov Report

Merging #1034 (5cff75a) into master (c55b32b) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1034   +/-   ##
=======================================
  Coverage   77.96%   77.96%           
=======================================
  Files          42       42           
  Lines        3163     3163           
=======================================
  Hits         2466     2466           
  Misses        697      697           
Flag Coverage Δ
unittests 77.96% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
nonebot/log.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c55b32b...5cff75a. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2022

🚀 Deployed on https://deploy-preview-1034--nonebot2.netlify.app

@github-actions github-actions bot temporarily deployed to pull request June 3, 2022 10:40 Inactive
@synodriver
Copy link
Member

这个logger改了可能影响有点大……

@yanyongyu yanyongyu added the enhancement New feature or request label Jun 3, 2022
Copy link
Member

@yanyongyu yanyongyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接删了就行

nonebot/log.py Outdated Show resolved Hide resolved
@yanyongyu
Copy link
Member

这个logger改了可能影响有点大……

并不影响logger的行为,只要terminal支持颜色默认还是彩色的

@yanyongyu yanyongyu changed the title ⚡ determine colorization automatically Feature: 日志记录自动检测终端是否支持彩色 Jun 3, 2022
@BlueGlassBlock
Copy link
Contributor Author

done. squash就好

@github-actions github-actions bot temporarily deployed to pull request June 3, 2022 12:07 Inactive
@yanyongyu yanyongyu merged commit 4241eb5 into nonebot:master Jun 3, 2022
@NekoAria
Copy link
Contributor

但是这样一来,用 pm2 托管的话,日志也没有彩色了。
其他守护进程程序我没试过,不清楚是否也会受此影响。

@NekoAria
Copy link
Contributor

能否加个配置项让用户自己设置呢?
比如:

log_colorize = False  # 默认

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

None yet

4 participants