-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix: fix chainlit sets logging while act as a library #2683
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
fix: fix chainlit sets logging while act as a library #2683
Conversation
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.
1 issue found across 2 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="backend/chainlit/cli/__init__.py">
<violation number="1" location="backend/chainlit/cli/__init__.py:34">
The new logging format drops the log level and logger name, so CLI logs no longer show whether a line is INFO, WARNING, or ERROR, making diagnosing issues significantly harder.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
|
@goatwu1993 While this PR fixes issue, I don't thin that's right solution, as it will change how logging is working for existing users. To make |
Tried it no luck. Also library package should almost NEVER config logging themself, making importer have to configure logging before/after chainlit import. |
|
Thanks @goatwu1993 - I also recently noticed that chainlit was doing this. You are correct, libraries should never configure global logging. |
fix #2682
Summary by cubic
Stop Chainlit from changing global logging when imported as a library. Move logging.basicConfig to the CLI entrypoint and remove it from chainlit.logger, while keeping socketio/engineio loggers at ERROR.
Written for commit aff41d1. Summary will update automatically on new commits.