File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
config/settings/debug_toolbar Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1- import logging
2-
1+ import structlog
32from django .urls import include , path
43
5- logger = logging .getLogger ("configuration" )
4+ logger = structlog .getLogger ("styleguide_example. configuration" )
65
76
87def show_toolbar (* args , ** kwargs ) -> bool :
8+ log = logger .bind ()
9+
910 """
1011 The general idea is the following:
1112
@@ -30,7 +31,7 @@ def show_toolbar(*args, **kwargs) -> bool:
3031 try :
3132 import debug_toolbar # noqa
3233 except ImportError :
33- logger .info ("No installation found for: django_debug_toolbar" )
34+ log .info ("django_debug_toolbar.setup" , message = "No installation found for: django_debug_toolbar" )
3435 return False
3536
3637 return True
@@ -43,8 +44,10 @@ class DebugToolbarSetup:
4344
4445 @staticmethod
4546 def do_settings (INSTALLED_APPS , MIDDLEWARE , middleware_position = None ):
47+ log = logger .bind ()
48+
4649 _show_toolbar : bool = show_toolbar ()
47- logger .info (f"Django Debug Toolbar in use: { _show_toolbar } " )
50+ log .info ("django_debuhg_toolbar.setup" , message = f"Django Debug Toolbar in use: { _show_toolbar } " )
4851
4952 if not _show_toolbar :
5053 return INSTALLED_APPS , MIDDLEWARE
You can’t perform that action at this time.
0 commit comments