-
Notifications
You must be signed in to change notification settings - Fork 421
Bug: programmatically changing the log level fails #2303
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
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Hey Paul, thank you so much for reporting this — could you tell me if
setting the log_level attribute to debug works?
powertools_logger.log_level = logging.DEBUG
If it does work, I suspect setLevel is changing the superclass and not
._logger as it should be.
Thanks a lot taking the time to report it, we should fix it — we welcome a
PR if you know your way around Python logging (logger.py file)
…On Mon, 22 May 2023 at 19:52, boring-cyborg[bot] ***@***.***> wrote:
Thanks for opening your first issue here! We'll come back to you as soon
as we can.
In the meantime, check out the #python channel on our AWS Lambda
Powertools Discord: Invite link <https://discord.gg/B8zZKbbyET>
—
Reply to this email directly, view it on GitHub
<#2303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZPQBGFL6I4NBC6OIV466TXHORWXANCNFSM6AAAAAAYKYVODM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
Hi @heitorlessa and @paulsuh! I could reproduce the error and it's changing the superclass Paul, do you want to send a PR to fix this and get your first contribution to Powertools? If not, I can send the PR to fix this and give you the credits. Thank you |
Let me clone the repo and see what I can do |
Hello @paulsuh! Can I help you write this fix? We are planning to release a new version today or tomorrow and it would be nice if we could include this fix. Thank you so much! |
|
This is now released under 2.16.1 version! |
Expected Behaviour
When changing the log level of a Logger via code, the log level should be changed.
Current Behaviour
When changing the log level of a Logger via code, the log level is not changed.
Code snippet
Possible Solution
No response
Steps to Reproduce
See https://github.com/paulsuh/aws-powertools-logging-test-sam for detailed test cases and output.
AWS Lambda Powertools for Python version
latest
AWS Lambda function runtime
3.9
Packaging format used
Serverless Application Repository (SAR) App
Debugging logs
No response
The text was updated successfully, but these errors were encountered: