Skip to content

🦄 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

Closed
wants to merge 2 commits into from

Conversation

obrua
Copy link
Contributor

@obrua obrua commented Jul 9, 2024

Unified log output using the loguru logging library

obrua added 2 commits July 9, 2024 14:02
Unified log output using the loguru logging library
@obrua obrua closed this Jul 9, 2024
@obrua obrua reopened this Jul 9, 2024
@obrua obrua closed this Jul 9, 2024
# print(frame, depth)
# while frame and frame.f_code and frame.f_code.co_filename == logging.__file__:
# frame = frame.f_back
# depth += 1
Copy link
Member

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获取
Copy link
Member

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
Copy link
Member

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

:return:
"""
from backend.common.log import setup_logging, set_customize_logfile
setup_logging("INFO")
Copy link
Member

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")
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants