-
Notifications
You must be signed in to change notification settings - Fork 176
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
Bug: Can't turn off CriticalLogMiddleware #1818
Comments
@mdgilene you can't remove CriticalLogMiddleware, but you can set its' logging level to DEBUG or even lower to not to see annoying messages. This is the official way to hide them. |
@Lancetnik As you have already noted, I guess this is more of an enhancement request than a bug then. The big glaring "TODO" right above this code seems to suggest that this definitely needs to be handled differently or be made optional entirely. At the very least, I think changing the "Received" and "Processed" logs to use a static DEBUG level instead of the globally configured level would be more inline with their purpose. It feels like this would be fairly straight forward. I can work on a PR if you'd like? In my case I am trying to provide a custom logger to the broker so just setting the log level doesn't seem to be viable since it would suppress the rest of the logs I do want to see. |
@mdgilene it doesn't set log level to whole logger. It is just log level for service message you mentioned. So, this option can be used with custom logger as well |
I am not sure about API, but you are always welcome with any PR. Even you idea will not be merged to main, we can inspire by it and implement any decision as a part of next 0.6 major |
Describe the bug
There seems to be no official way to turn of this middleware by default. After looking through the code the only viable option would be to set the
PYTEST_CURRENT_TEST
env var even when I'm not running my tests...which just seems silly. Not being able to turn this off clutters the logs with unnecessary messages.How to reproduce
Setup a FastStream broker and watch for "Recieved" and "Processed" messages all over the place.
Expected behavior
The ability to turn this off.
Environment
Running FastStream 0.5.23 with CPython 3.12.3 on Linux
faststream/faststream/broker/core/usecase.py
Lines 177 to 182 in 7c069db
The text was updated successfully, but these errors were encountered: