Skip to content
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

Cannot be used with loguru. #66

Open
kietdev-218 opened this issue Mar 21, 2024 · 1 comment
Open

Cannot be used with loguru. #66

kietdev-218 opened this issue Mar 21, 2024 · 1 comment

Comments

@kietdev-218
Copy link

When I use it:
from loguru import logger

@Retry(requests.exceptions.RequestException, tries=4, delay=2, logger=logger)

It is not possible to print the complete log like using logging, it only prints the content "%s, retrying in %s seconds..."

@daniel-lightlytics
Copy link

+1
The internal call to logger.warning can be convenient at times, but is constraining.
Should consider adding a new param for this - to provide a logging function, so the users can decide how to exactly handle retry attempt logging.
If I want to intercept the call to use a 3rd party logger which does not support the logger.warning call with the given params,
or I want to divert this log to an other log level, I will need to implement a wrapper class for this, instead of, lets say, a local function wrap to delegate this call to my existing logger.

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

No branches or pull requests

2 participants