-
Notifications
You must be signed in to change notification settings - Fork 429
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
native logger integration / dep loglevel config? #649
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 @KiaraGrouwstra thank you for creating it - apologies for the delay, just got back from a long vacation. For setting the log level, you can use either Child loggers ( We don't plan to add a YAML based config as you don't need to configure it like you do the traditional logger, you simply do Does that help? I'm more than happy to clarify any questions you might have. |
hi, |
Ah! I totally misunderstood, sorry.
You can get the namespace logger and set the level as you normally would
with any logging that used std logging[1].
Could you share the workflow you have in mind so I can share a snippet with
you?
I don’t wanna assume you want to propagate down, upwards, or in another way
I might not be thinking.
-----------
Edited to add an initial snippet in case it's helpful.
[1] Creating a Logger named `booking` and setting their log level to DEBUG elsewhere in the code
```python
# app.py
from aws_lambda_powertools import Logger
logger = Logger(service="booking")
# somewhere in the code
import logging
booking_logger = logging.getLogger("booking") # we name the logger using service name value
booking_logger.setLevel("DEBUG")
```
…On Mon, 27 Sep 2021 at 17:08, Kiara Grouwstra ***@***.***> wrote:
hi,
this issue i'm concerned about is about dependencies.
i know that for my own code i can control which logging level of messages
will be printed.
the issue is, i'm consuming other pip packages that log things as well,
and in some cases turn out buggy.
in such cases, i would like to be able to print debug-level info for such
a broken package.
that is something that by default python logging can achieve. however, as
i currently understand it, since the powertools logging library does not
hook into this built-in way of logging, it lacks that functionality.
is this understanding correct?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#649 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZPQBDWTQS6CVZBDXQSFNDUECCHDANCNFSM5CWMENMQ>
.
|
Checking in to see if this helped, and whether we could have more details on the issue report about the workflow to address this properly |
hi there, |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Python comes with some logging niceties built-in, among which the ability to use yaml-based configuration for logging. this facilitates e.g. the configuration of logging levels of dependencies.
this sounds nice, but i'm not sure how to achieve something similar with powertools's logger. is this something that is currently possible, or might this be desirable as a potential enhancement?
The text was updated successfully, but these errors were encountered: