Skip to content

Release 0.5.0 #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.5.0 (2020-08-27)

- Updated supported ECS version to 1.6.0 ([#24](https://github.com/elastic/ecs-logging-python/pull/24))
- Added support for `LogRecord.stack_info` ([#23](https://github.com/elastic/ecs-logging-python/pull/23))
- Fixed normalizing of items in `list` that aren't of type
`dict` ([#22](https://github.com/elastic/ecs-logging-python/pull/22), contributed by [`@camerondavison`](https://github.com/camerondavison))

## 0.4 (2020-08-04)

- Added automatic collection of ECS fields `trace.id`, `span.id`, and `transaction.id` for
Expand Down
2 changes: 1 addition & 1 deletion ecs_logging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from ._stdlib import StdlibFormatter
from ._structlog import StructlogFormatter

__version__ = "0.4"
__version__ = "0.5.0"
__all__ = [
"ECS_VERSION",
"StdlibFormatter",
Expand Down
2 changes: 1 addition & 1 deletion ecs_logging/_meta.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ECS_VERSION = "1.5.0"
ECS_VERSION = "1.6.0"
8 changes: 4 additions & 4 deletions tests/test_apm.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_elasticapm_structlog_log_correlation_ecs_fields():
ecs = json.loads(stream.getvalue().rstrip())
ecs.pop("@timestamp")
assert ecs == {
"ecs": {"version": "1.5.0"},
"ecs": {"version": "1.6.0"},
"log": {"level": "info"},
"message": "test message",
"span": {"id": span_id},
Expand Down Expand Up @@ -71,7 +71,7 @@ def test_elastic_apm_stdlib_no_filter_log_correlation_ecs_fields():

ecs = json.loads(stream.getvalue().rstrip())
assert ecs == {
"ecs": {"version": "1.5.0"},
"ecs": {"version": "1.6.0"},
"log": {
"level": "info",
"logger": "apm-logger",
Expand Down Expand Up @@ -115,7 +115,7 @@ def test_elastic_apm_stdlib_with_filter_log_correlation_ecs_fields():

ecs = json.loads(stream.getvalue().rstrip())
assert ecs == {
"ecs": {"version": "1.5.0"},
"ecs": {"version": "1.6.0"},
"log": {
"level": "info",
"logger": "apm-logger",
Expand Down Expand Up @@ -162,7 +162,7 @@ def test_elastic_apm_stdlib_exclude_fields():

ecs = json.loads(stream.getvalue().rstrip())
assert ecs == {
"ecs": {"version": "1.5.0"},
"ecs": {"version": "1.6.0"},
"log": {
"level": "info",
"logger": "apm-logger",
Expand Down
8 changes: 4 additions & 4 deletions tests/test_stdlib_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_record_formatted():
formatter = ecs_logging.StdlibFormatter(exclude_fields=["process"])

assert formatter.format(make_record()) == (
'{"@timestamp":"2020-03-20T14:12:46.123Z","ecs":{"version":"1.5.0"},'
'{"@timestamp":"2020-03-20T14:12:46.123Z","ecs":{"version":"1.6.0"},'
'"log":{"level":"debug","logger":"logger-name","origin":{"file":{"line":10,"name":"file.py"},'
'"function":"test_function"},"original":"1: hello"},"message":"1: hello"}'
)
Expand All @@ -54,7 +54,7 @@ def format_to_ecs(self, record):

formatter = CustomFormatter(exclude_fields=["process"])
assert formatter.format(make_record()) == (
'{"@timestamp":"2020-03-20T14:12:46.123Z","custom":"field","ecs":{"version":"1.5.0"},'
'{"@timestamp":"2020-03-20T14:12:46.123Z","custom":"field","ecs":{"version":"1.6.0"},'
'"log":{"level":"debug","logger":"logger-name","origin":{"file":{"line":10,"name":"file.py"},'
'"function":"test_function"},"original":"1: hello"},"message":"1: hello"}'
)
Expand All @@ -68,7 +68,7 @@ def test_can_be_set_on_handler():
handler.handle(make_record())

assert stream.getvalue() == (
'{"@timestamp":"2020-03-20T14:12:46.123Z","ecs":{"version":"1.5.0"},'
'{"@timestamp":"2020-03-20T14:12:46.123Z","ecs":{"version":"1.6.0"},'
'"log":{"level":"debug","logger":"logger-name","origin":{"file":{"line":10,"name":"file.py"},'
'"function":"test_function"},"original":"1: hello"},"message":"1: hello"}\n'
)
Expand Down Expand Up @@ -102,7 +102,7 @@ def test_extra_is_merged(time, logger):
assert isinstance(ecs["log"]["origin"]["file"].pop("line"), int)
assert ecs == {
"@timestamp": "2020-03-20T16:16:37.187Z",
"ecs": {"version": "1.5.0"},
"ecs": {"version": "1.6.0"},
"log": {
"level": "info",
"logger": logger.name,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_structlog_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_event_dict_formatted(time):

formatter = ecs_logging.StructlogFormatter()
assert formatter(None, "debug", make_event_dict()) == (
'{"@timestamp":"2020-03-20T16:16:37.187Z","ecs":{"version":"1.5.0"},'
'{"@timestamp":"2020-03-20T16:16:37.187Z","ecs":{"version":"1.6.0"},'
'"log":{"level":"debug","logger":"logger-name"},"message":"test message"}'
)

Expand All @@ -36,6 +36,6 @@ def test_can_be_set_as_processor(time):

assert stream.getvalue() == (
'{"@timestamp":"2020-03-20T16:16:37.187Z","custom":"key",'
'"dot":{"ted":1},"ecs":{"version":"1.5.0"},"log":{"level":"debug"},'
'"dot":{"ted":1},"ecs":{"version":"1.6.0"},"log":{"level":"debug"},'
'"message":"test message"}\n'
)