2222except NameError :
2323 basestring = str
2424
25- if sys .version_info < (3 , 0 ):
26- EASY_SERIALIZABLE_TYPES = (basestring , bool , dict , float , int , list , type (None ))
27- else :
28- LOG_RECORD_BUILT_IN_ATTRS .append ('stack_info' )
29- EASY_SERIALIZABLE_TYPES = (str , bool , dict , float , int , list , type (None ))
25+ LOG_RECORD_BUILT_IN_ATTRS .append ('stack_info' )
26+ EASY_SERIALIZABLE_TYPES = (str , bool , dict , float , int , list , type (None ))
3027
3128
3229def _sanitize_log_msg (record ):
@@ -45,7 +42,7 @@ class BaseJSONFormatter(logging.Formatter):
4542 base_object_common = {}
4643
4744 def __init__ (self , * args , ** kw ):
48- super (BaseJSONFormatter , self ).__init__ (* args , ** kw )
45+ super ().__init__ (* args , ** kw )
4946 if json_logging .COMPONENT_ID and json_logging .COMPONENT_ID != json_logging .EMPTY_VALUE :
5047 self .base_object_common ["component_id" ] = json_logging .COMPONENT_ID
5148 if json_logging .COMPONENT_NAME and json_logging .COMPONENT_NAME != json_logging .EMPTY_VALUE :
@@ -120,7 +117,7 @@ def format_exception(cls, exc_info):
120117 return '' .join (traceback .format_exception (* exc_info )) if exc_info else ''
121118
122119 def _format_log_object (self , record , request_util ):
123- json_log_object = super (JSONLogFormatter , self )._format_log_object (record , request_util )
120+ json_log_object = super ()._format_log_object (record , request_util )
124121
125122 json_log_object .update ({
126123 "msg" : _sanitize_log_msg (record ),
@@ -144,7 +141,7 @@ class JSONLogWebFormatter(JSONLogFormatter):
144141 """
145142
146143 def _format_log_object (self , record , request_util ):
147- json_log_object = super (JSONLogWebFormatter , self )._format_log_object (record , request_util )
144+ json_log_object = super ()._format_log_object (record , request_util )
148145
149146 if json_logging .CORRELATION_ID_FIELD not in json_log_object :
150147 json_log_object .update ({
@@ -160,7 +157,7 @@ class JSONRequestLogFormatter(BaseJSONFormatter):
160157 """
161158
162159 def _format_log_object (self , record , request_util ):
163- json_log_object = super (JSONRequestLogFormatter , self )._format_log_object (record , request_util )
160+ json_log_object = super ()._format_log_object (record , request_util )
164161
165162 request_adapter = request_util .request_adapter
166163 response_adapter = request_util .response_adapter
0 commit comments