-
Notifications
You must be signed in to change notification settings - Fork 469
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
use different colors to distinguish logs #2333
use different colors to distinguish logs #2333
Conversation
superduper/base/logger.py
Outdated
"| {extra[hostname]: <8}" | ||
"| {name}:{line: <4} " | ||
"| {message}" | ||
"<green> {time:YYYY-MMM-DD HH:mm:ss.SS}</green>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be configurable. We had this before, and it made life difficult with our ray
deployments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @blythed.I update it. please review it. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address the comment.
superduper/base/config.py
Outdated
:param use_colors: Whether to use colors in the log output | ||
""" | ||
|
||
default_format: str = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't do it like this.
I would add a variable to the config colorize
and then in the logging module do one or the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config.py
colorize: bool = True
logging.py
if CFG.logging.colorize:
message = (
"<green>{time:YYYY-MMM-DD HH:mm:ss.SS}</green>"
"| <level>{level: <8}</level> "
"| <cyan>{extra[hostname]: <8}</cyan>"
"| <cyan>{name}</cyan>:<cyan>{line: <4}</cyan> "
f"| <level>{message}</level>"
)
else:
message = (
"{time:YYYY-MMM-DD HH:mm:ss.SS}"
"| {level: <8} "
"| {name}:{line: <4} "
f"| {message}"
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config.py
colorize: bool = True
logging.py
if CFG.logging.colorize: message = ( "<green>{time:YYYY-MMM-DD HH:mm:ss.SS}</green>" "| <level>{level: <8}</level> " "| <cyan>{extra[hostname]: <8}</cyan>" "| <cyan>{name}</cyan>:<cyan>{line: <4}</cyan> " f"| <level>{message}</level>" ) else: message = ( "{time:YYYY-MMM-DD HH:mm:ss.SS}" "| {level: <8} " "| {name}:{line: <4} " f"| {message}" )
Ok,I have changed
Thanks @EdwardLi-coder! |
Description
Use different colors to distinguish logs
Related Issues
[LOGGING-IMPR] Use different colors to distinguish logs #2327
Checklist
make unit_testing
andmake integration-testing
successfully?Additional Notes or Comments