File tree Expand file tree Collapse file tree 5 files changed +9
-7
lines changed Expand file tree Collapse file tree 5 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
6
6
The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ ) .
7
7
8
+ ## 4.2.7 - 2024-06-27
9
+
10
+ ### Fixed
11
+
12
+ - Remove stacktrace from the message element of the log
13
+
8
14
## 4.2.6 - 2024-02-26
9
15
10
16
### Update
Original file line number Diff line number Diff line change 10
10
from sap .cf_logging .record .request_log_record import RequestWebRecord
11
11
from sap .cf_logging .record .simple_log_record import SimpleLogRecord
12
12
13
- __version__ = '4.2.6 '
13
+ __version__ = '4.2.7 '
14
14
15
15
_SETUP_DONE = False
16
16
FRAMEWORK = None
Original file line number Diff line number Diff line change @@ -79,8 +79,6 @@ def format(self):
79
79
stacktrace = '' .join (traceback .format_exception (* self .exc_info ))
80
80
stacktrace = format_stacktrace (stacktrace )
81
81
record ['stacktrace' ] = stacktrace .split ('\n ' )
82
- record ['msg' ] += "\n "
83
- record ['msg' ] += stacktrace
84
82
85
83
86
84
record .update (self .extra )
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ def test_exception_stacktrace():
68
68
69
69
assert error == {}
70
70
assert 'ZeroDivisionError' in str (log_json ['stacktrace' ])
71
- assert 'ZeroDivisionError' in log_json ["msg" ]
71
+ assert log_json ["msg" ] == 'zero division error'
72
72
73
73
74
74
def test_exception_stacktrace_info_level ():
@@ -85,7 +85,7 @@ def test_exception_stacktrace_info_level():
85
85
86
86
assert error == {}
87
87
assert 'ZeroDivisionError' in str (log_json ['stacktrace' ])
88
- assert 'ZeroDivisionError' in log_json ["msg" ]
88
+ assert log_json ["msg" ] == 'zero division error'
89
89
90
90
91
91
def test_custom_fields_set ():
Original file line number Diff line number Diff line change @@ -47,6 +47,4 @@ def test_stacktrace_is_added_to_msg_field():
47
47
record_object = json .loads (FORMATTER .format (log_record ))
48
48
assert "Dummy Exception" in "" .join (record_object ["stacktrace" ])
49
49
expected_msg = "Error found!"
50
- expected_msg += "\n "
51
- expected_msg += "\n " .join (record_object ["stacktrace" ])
52
50
assert record_object ["msg" ] == expected_msg
You can’t perform that action at this time.
0 commit comments