Nebo15 / logger_json

JSON logger formatter with support for Google Cloud, DataDog and other for Elixir.
https://nebo15.github.io/logger_json/
MIT License
237 stars 92 forks source link

Translate warn to warning for Elixir >= 1.11.0 #113

Closed altjohndev closed 7 months ago

altjohndev commented 8 months ago

Logger.compare_levels/2 triggers IO.warn/1 whenever we use it with :warn as parameter:

Sadly, any backend configured for Logger will translate :warning level to :warn for backward compatibility (ref), which makes the current implementation of this library to always trigger the IO warn message for warning logs.

This PR addresses that by converting the log :warn level to :warning before calling Logger.compare_levels/2 for Elixir >= 1.11.0.

altjohndev commented 7 months ago

Hi @AndrewDryga is this library currently active and accepting PRs?

AndrewDryga commented 7 months ago

Hello @altjohndev, sure we accept PR's. But I have a strong feeling that I want to rewrite this library as a logger formatter now :)

andreyuhai commented 7 months ago

Could we get a release with this PR, please? We have the same issue spamming us. Until then we could use the commit hash. Turns out we can't, since our package depends on this package. :/

AndrewDryga commented 7 months ago

@andreyuhai @altjohndev sorry for making you wait guys, was trying to test it in our production first :). The version is published.