Skip to content

Commit

Permalink
Update "showwarning" example to preserve location (#1076)
Browse files Browse the repository at this point in the history
  • Loading branch information
Delgan committed Feb 1, 2024
1 parent 49b5c29 commit af6a310
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/resources/recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ You may also capture warnings emitted by your application by replacing |warnings
showwarning_ = warnings.showwarning

def showwarning(message, *args, **kwargs):
logger.warning(message)
logger.opt(depth=2).warning(message)
showwarning_(message, *args, **kwargs)

warnings.showwarning = showwarning
Expand Down

0 comments on commit af6a310

Please sign in to comment.