@@ -288,9 +288,10 @@ def test_log_exceptions_full_msg():
288288 json .loads (test_jsons )
289289 except Exception as e :
290290 log .log_exception (mock_logger , e , "test type1" , msg_before = start_msg )
291+ err_msg = traceback .format_exc ().replace ("\n " , " " ).rstrip ()
291292 mock_logger .log .assert_called_with (
292293 logging .ERROR ,
293- f'exc_l="test type1" { start_msg } \n { traceback . format_exc () } \n ' ,
294+ f'exc_l="test type1" | { start_msg } | { err_msg } ' ,
294295 )
295296
296297
@@ -312,8 +313,8 @@ def test_log_exceptions_partial_msg():
312313 )
313314 mock_logger .log .assert_called_with (
314315 logging .ERROR ,
315- 'exc_l="test type" some msg before exception\n json .decoder.JSONDecodeError: Expecting property '
316- "name enclosed in double quotes: line 1 column 2 (char 1)\n \n some msg after exception" ,
316+ 'exc_l="test type" | some msg before exception | json .decoder.JSONDecodeError: Expecting property '
317+ "name enclosed in double quotes: line 1 column 2 (char 1) | some msg after exception" ,
317318 )
318319
319320
@@ -337,8 +338,9 @@ class AddonComplexError(Exception):
337338 except AddonComplexError as e :
338339 fun = getattr (log , func )
339340 fun (mock_logger , e )
341+ err_msg = traceback .format_exc ().replace ("\n " , " " ).rstrip ()
340342 mock_logger .log .assert_called_with (
341- logging .ERROR , f"exc_l={ result } \n { traceback . format_exc () } \n "
343+ logging .ERROR , f"exc_l={ result } | { err_msg } "
342344 )
343345
344346
0 commit comments