-
-
Notifications
You must be signed in to change notification settings - Fork 307
Closed
Description
Loguru is not api compatible with standard logging despite efforts in #294, so it may be best to raise an error or wrap the loguru logger with a standard logger when doing this
from loguru import logger
@retry(
stop=stop_after_attempt(10),
wait=wait_random_exponential(multiplier=1, max=10),
reraise=True,
before_sleep=before_sleep_log(logger, "ERROR"), # type: ignore
after=after_log(logger, "ERROR"), # type: ignore
)As it can cause a KeyError due to this
Here's a wrapping approach which may be the best thing for people to setup in accordance with their own logging needs. Not sure if @Delgan has a better approach though.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels