Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Json Formatter overridden by _get_json_formatter #401

Open
djpugh opened this issue Jun 20, 2021 · 1 comment
Open

Json Formatter overridden by _get_json_formatter #401

djpugh opened this issue Jun 20, 2021 · 1 comment

Comments

@djpugh
Copy link

djpugh commented Jun 20, 2021

  • logzero version: 1.7.0
  • Python version: 3.7.9
  • Operating System: Windows 10

Description

Thanks for the great library!
I was setting up a custom JSON formatter for logging a specific json message (using a custom json default), however this was stymied through

_formatter = _get_json_formatter(json_ensure_ascii) if json else formatter or LogFormatter()

    _formatter = _get_json_formatter(json_ensure_ascii) if json else formatter or LogFormatter()

Is this intended behaviour (happy to override the formatter in the handler after creating?

Otherwise would suggest checking if isinstance(formatter, JsonFormatter)?

@djpugh
Copy link
Author

djpugh commented Jun 20, 2021

Happy to contribute the change, want to check if the behaviour is intended first!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant