@@ -149,19 +149,22 @@ def wrap(cls):
149149 return wrap (decorated_cls )
150150
151151
152- def method_logger (method = None , / , * , custom_base_name : Optional [str ] = None ):
152+ def method_logger (method = None , / , * , custom_base_name : Optional [str ] = None ):
153153 """Decorator that adds logging functionality to a method."""
154154
155155 def outer_wrapper (method ):
156-
157156 @functools .wraps (method )
158157 def wrapper (* args , ** kwargs ):
159158 api_method_name = getattr (method , LOG_OVERRIDE_NAME , method .__name__ )
160159 if custom_base_name is None :
161- qualname_parts = getattr (method , "__qualname__" , method .__name__ ).split ("." )
160+ qualname_parts = getattr (method , "__qualname__" , method .__name__ ).split (
161+ "."
162+ )
162163 class_name = qualname_parts [- 2 ] if len (qualname_parts ) > 1 else ""
163164 base_name = (
164- class_name if class_name else "_" .join (method .__module__ .split ("." )[1 :])
165+ class_name
166+ if class_name
167+ else "_" .join (method .__module__ .split ("." )[1 :])
165168 )
166169 else :
167170 base_name = custom_base_name
@@ -194,13 +197,13 @@ def wrapper(*args, **kwargs):
194197 _call_stack .pop ()
195198
196199 return wrapper
197-
200+
198201 if method is None :
199202 # Called with parentheses
200203 return outer_wrapper
201204
202205 # Called without parentheses
203- return outer_wrapper (method )
206+ return outer_wrapper (method )
204207
205208
206209def property_logger (prop ):
0 commit comments