Skip to content
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

Logger backends uses deprecated :warn instead of :warning #7

Open
vkryukov opened this issue Nov 26, 2024 · 0 comments
Open

Logger backends uses deprecated :warn instead of :warning #7

vkryukov opened this issue Nov 26, 2024 · 0 comments

Comments

@vkryukov
Copy link

Hello,

I noticed a small annoyance when developing a custom logger backend: a warning message about deprecated usage of :warn is produced. It can be illustrated by the following code:

victor@Mac ~/s/logger_default_handler (main)> mix run lib/logger_default_handler.exs
warning: the log level :warn is deprecated, use :warning instead
  (logger 1.17.3) lib/logger.ex:1178: Logger.elixir_level_to_erlang_level/1
  (logger 1.17.3) lib/logger.ex:635: Logger.compare_levels/2
  (logger_backends_sql 0.1.0) lib/logger_backends_sql.ex:122: LoggerBackends.SQL.meet_level?/2
  (logger_backends_sql 0.1.0) lib/logger_backends_sql.ex:79: LoggerBackends.SQL.handle_event/2
  (stdlib 6.1.2) gen_event.erl:1921: :gen_event.server_update/4
  (stdlib 6.1.2) gen_event.erl:1903: :gen_event.server_notify/4


11:14:19.305 [warning] This is a warning message

11:14:19.305 [error] This is an error message
You should see that unconditionally
victor@Mac ~/s/logger_default_handler (main)> 

The culprit is this line, and the fix is really a one-liner which I will do in a pull request.

vkryukov added a commit to vkryukov/logger_backends that referenced this issue Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant