Skip to content

Commit

Permalink
exclude middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
colinbowen committed Dec 11, 2024
1 parent 763161c commit 490eb04
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/logger_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ def format(self, record):
caller_module = ""

for frame in inspect.stack():
if "app.logger_config" not in str(
frame.frame.f_globals.get("__name__")
module_name = str(frame.frame.f_globals.get("__name__", ""))
if (
"app.logger_config" not in module_name
and "app.main.middlewares.log_page_view" not in module_name
):
if "app." in str(frame.frame.f_globals.get("__name__")):
if "app." in module_name:
caller_function = frame.function
caller_module = frame.frame.f_globals.get("__name__", "")
caller_module = module_name
break

if has_request_context():
Expand Down

0 comments on commit 490eb04

Please sign in to comment.