Fix logging output routing and added colorized logging (#205, #206)#210
Fix logging output routing and added colorized logging (#205, #206)#210TimidRobot merged 1 commit intocreativecommons:mainfrom
Conversation
|
About the basicConfig thing, I tried keeping it at first but it messed with the new handlers, so I just replaced it entirely. Used a dictionary for the colors since it was easier than a bunch of if statements. Did both issues together since #206 needed #205 done first anyway. Thanks @TimidRobot for the clear issue descriptions, made it much easier to understand what was needed! |
TimidRobot
left a comment
There was a problem hiding this comment.
Great work!
A couple of the comments are asking you to fix my own mistakes 🙃
Testing this was made a little more difficult due to the branch/PR being out of date (not synchronized with main). I suspect this is also why the changes to the update_readme function were included.
Which tests did you add or update?
What documentation did you update? |
I apologize, I missed the "(if applicable)" part and checked those boxes without thinking. I'm still learning the open source contribution process and will be more careful with the checklist. Thanks for your valuable guidance. |
Updated WARNING and ERROR codes to use the correct foreground colors. Added Wikipedia reference comment above COLORS.
|
Hey, @TimidRobot Fixed all the issues you mentioned: i myself Tested locally and confirmed the colors display correctly. |
TimidRobot
left a comment
There was a problem hiding this comment.
This will be helpful, thank you!
Fixes
Description
Fixed logging output routing so info/warning messages go to stdout and errors go to stderr. Also added colors to log messages so they're easier to read in the terminal.
Technical details
Replaced basicConfig() with dual handlers for proper output routing, then added a ColoredFormatter class with the ANSI color codes.
Tests
Run
python scripts/1-fetch/gcs_fetch.py --helpand you'll see colored log output routed correctly.Screenshots
Checklist
Update index.md).mainormaster).visible errors.
Developer Certificate of Origin
For the purposes of this DCO, "license" is equivalent to "license or public domain dedication," and "open source license" is equivalent to "open content license or public domain dedication."
Developer Certificate of Origin