File tree 4 files changed +6
-7
lines changed
4 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Unreleased
4
4
5
- * Fix for duplicate dotted keys ([ #46 ] )
5
+ * Fixed an issue in ` StructlogFormatter ` caused by a conflict with ` event `
6
+ (used for the log ` message ` ) and ` event.dataset ` (a field provided by the
7
+ ` elasticapm ` integration) ([ #46 ] ( https://github.com/elastic/ecs-logging-python/pull/46 ) )
6
8
7
9
## 1.0.0 (2021-02-08)
8
10
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ def merge_dicts(from_, into):
114
114
into .setdefault (key , {})
115
115
if isinstance (value , dict ) and isinstance (into [key ], dict ):
116
116
merge_dicts (value , into [key ])
117
- elif into [key ]:
117
+ elif into [key ] != {} :
118
118
raise TypeError (
119
119
"Type mismatch at key `{}`: merging dicts would replace value `{}` with `{}`. This is likely due to "
120
120
"dotted keys in the event dict being turned into nested dictionaries, causing a conflict." .format (
Original file line number Diff line number Diff line change @@ -92,6 +92,8 @@ def validator(data_json):
92
92
93
93
@pytest .fixture
94
94
def apm ():
95
+ if sys .version_info < (3 , 6 ):
96
+ pytest .skip ("elasticapm only supports python 3.6+" )
95
97
if sys .version_info [0 ] >= 3 :
96
98
record_factory = logging .getLogRecordFactory ()
97
99
apm = elasticapm .Client ({"SERVICE_NAME" : "apm-service" , "DISABLE_SEND" : True })
Original file line number Diff line number Diff line change 27
27
from .compat import StringIO
28
28
29
29
30
- # elasticapm only supports python 3.6+
31
- if sys .version_info < (3 , 6 ):
32
- pytestmark = [pytest .mark .skip ]
33
-
34
-
35
30
def test_elasticapm_structlog_log_correlation_ecs_fields (spec_validator , apm ):
36
31
stream = StringIO ()
37
32
logger = structlog .PrintLogger (stream )
You can’t perform that action at this time.
0 commit comments