Skip to content

Conversation

dustinfarris
Copy link

Translating an erlang :warning to an elixir :warn causes custom backends that still rely on this implementation to trigger the hard deprecation on Logger.warn.

Translating an erlang :warning to an elixir :warn causes custom backends
that still rely on this implementation to trigger the hard deprecation
on `Logger.warn`.
@josevalim
Copy link
Member

@dustinfarris can you please provide steps to reproduce? Do you mean that Logger.warning with a custom backend will emit deprecation warnings?

@dustinfarris
Copy link
Author

Yes correct. I have

Logger.warning("not authorized")

which was picked up by the custom backend in getsentry/sentry-elixir — and got a deprecation notice. We are using --warnings-as-errors which started tripping when we upgraded to 1.15.

@dustinfarris
Copy link
Author

also i recompiled logger with this change and it made the deprecation notice go away

@josevalim
Copy link
Member

Unfortunately your change is a breaking change, because old backends are not expected to receive :warning, only :warn. I am assuming Sentry forwards its messages to Logger and, if that's the case, it has to convert :warn to :warning by itself. Thank you!

@josevalim josevalim closed this Jun 22, 2023
@josevalim
Copy link
Member

If you can pinpoint from where the log level comes from in Sentry, I will be glad to provide tips or review a PR there. But at the moment it doesn't look like an Elixir bug.

@dustinfarris
Copy link
Author

Thanks @josevalim — this PR fixes it on sentry's end: getsentry/sentry-elixir#553

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

Successfully merging this pull request may close these issues.

2 participants