Logged exceptions shouldn't contain colour
Opened this issue · 13 comments
Currently if the output is to a terminal, then an exception that gets logged will also include the colour escape codes. This is not really ideal since they will just show up as raw escape codes in most editors, making the log harder to read. So it would be great if the logged exceptions could skip the colour-coding even if the current terminal supports colours. The output to the terminal itself should still be coloured of course. Thanks!
IssueHunt Summary
Backers (Total: $50.00)
issuehunt ($50.00)
Submitted pull Requests
Become a backer now!
Or submit a pull request to get the deposits!
Tips
- Checkout the Issuehunt explorer to discover more funded issues.
- Need some help from other developers? Add your repositories on IssueHunt to raise funds.
IssueHunt has been backed by the following sponsors. Become a sponsor
I'm confused.
Currently if the output is to a terminal, then an exception that gets logged will also include the colour escape codes.
Yes, correct. That's how terminal colors work :p
This is not really ideal since they will just show up as raw escape codes in most editors, making the log harder to read.
Which editors? Where?
So it would be great if the logged exceptions could skip the colour-coding even if the current terminal supports colours.
Why would that be great? That just means no color.
The output to the terminal itself should still be coloured of course
I'm completely lost. What issue are you facing?
I mean that exception colours will also be present in log files that get written when using the logging
module, for example when using logging.exception("oops")
. These escape codes don't really belong in log files, only in direct terminal output, because editors that you would use to inspect log files are (generally) not terminals.
Ohhh, you mean with the logging module. Okay, I agree. I'm not near a computer right now as I'm sick, but I'll try to reproduce in a while.
No problem :)
Yes, I'm facing the same issue. Could you please consider adding an option to disable coloring?
@issuehunt has funded $50.00 to this issue.
- Submit pull request via IssueHunt to receive this reward.
- Want to contribute? Chip in to this issue via IssueHunt.
- Checkout the IssueHunt Issue Explorer to see more funded issues.
- Need help from developers? Add your repository on IssueHunt to raise funds.
@Qix- @majutsushi any update on this??? as i understand we don't want the color ASCII characters to include while logging to files...
@lokesh1729 As is with most OSS, if it is not updated on this issue, then there is no update. We don't secretly discuss/code outside of Github. Please don't spam my issues with comments asking for updates.
@Qix- i understand but my intention is not to spam but to contribute... i want to work on this issue, so "update" i mean is wanted to know if someone has already made a progress on it...
Nope, nobody has made progress on it.
I can’t reproduce this. Whenever the logging
module is involved, nothing of the output is colored. Maybe someone can provide a MCVE.
Hello I c this issue still open? I can have a look