Skip to content

Add default/fallback behavior for json.dumps - #47

Merged
basepi merged 10 commits into
elastic:masterfrom
basepi:objectserialization41
Jul 1, 2021
Merged

Add default/fallback behavior for json.dumps#47
basepi merged 10 commits into
elastic:masterfrom
basepi:objectserialization41

Conversation

@basepi

@basepi basepi commented Jun 29, 2021

Copy link
Copy Markdown
Contributor

Fixes #41

@ghost

ghost commented Jun 29, 2021

Copy link
Copy Markdown

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #47 updated

  • Start Time: 2021-07-01T16:37:01.960+0000

  • Duration: 9 min 19 sec

  • Commit: 8cfd4b3

Test stats 🧪

Test Results
Failed 0
Passed 238
Skipped 11
Total 249

Trends 🧪

Image of Build Times

Image of Tests

@sethmlarson sethmlarson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still kinda "eh" about whether we should simply smooth over errors where the user isn't giving us something JSON serializable? Isn't an error better in this case instead of polluting their logs cluster with object reprs?

Comment thread ecs_logging/_utils.py Outdated
@basepi

basepi commented Jun 29, 2021

Copy link
Copy Markdown
Contributor Author

@sethmlarson Obviously at least one person has run into this, and expects us to not fail but rather deal with the object. Doing it this way allows a user to add the __structlog__() method to give it a good log representation. The __repr__() backup will make it pretty obvious what's going on as well IMO.

@sethmlarson sethmlarson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@beniwohli beniwohli left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@basepi

basepi commented Jun 30, 2021

Copy link
Copy Markdown
Contributor Author

Just waiting on #46 which will turn these tests green.

@sethmlarson sethmlarson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functools.partial change looks good to me!

@basepi
basepi merged commit bb4647f into elastic:master Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

structlog integration - TypeError when passing object

3 participants