-
-
Notifications
You must be signed in to change notification settings - Fork 198
🦄 refactor: optimize log output #345
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
Conversation
Unified log output using the loguru logging library
# print(frame, depth) | ||
# while frame and frame.f_code and frame.f_code.co_filename == logging.__file__: | ||
# frame = frame.f_back | ||
# depth += 1 |
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 delete the comments and code here.
# depth += 1 | ||
|
||
# Find caller from where originated the logged message. | ||
# 换成inspect获取 |
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.
Delete this comment.
|
||
# remove every other logger's handlers | ||
# and propagate to root logger | ||
# noinspection PyUnresolvedReferences |
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.
The comment here does not match the code
backend/core/registrar.py
Outdated
:return: | ||
""" | ||
from backend.common.log import setup_logging, set_customize_logfile | ||
setup_logging("INFO") |
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.
Add logging level configuration to core/conf.py
backend/main.py
Outdated
config = uvicorn.Config(app=f'{Path(__file__).stem}:app', reload=True) | ||
server = uvicorn.Server(config) | ||
from backend.common.log import setup_logging | ||
setup_logging("INFO") |
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.
Remove this function to globally use the registration configuration by default.
Unified log output using the loguru logging library