Skip to content

Commit

Permalink
fix: Let log viewers show meaningful stack info (#2019)
Browse files Browse the repository at this point in the history
Backported-from: main (24.09)
Backported-to: 23.09
  • Loading branch information
achimnol committed Apr 12, 2024
1 parent 01b8e3c commit fe1428c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/2019.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Let external log viewers display more accurate, meaningful stack frames of logger invocations.
1 change: 1 addition & 0 deletions src/ai/backend/common/logging_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def __init__(self, logger, extra=None):
def log(self, level, msg, *args, **kwargs):
if self.isEnabledFor(level):
msg, kwargs = self.process(msg, kwargs)
kwargs["stacklevel"] = kwargs.get("stacklevel", 1) + 1
self.logger._log(level, BraceMessage(msg, args), (), **kwargs)


Expand Down

0 comments on commit fe1428c

Please sign in to comment.