Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

allow new log levels #63

Merged
merged 4 commits into from
Jun 19, 2024
Merged

Conversation

ruslandoga
Copy link
Contributor

@ruslandoga ruslandoga commented Jun 16, 2024

👋

I'd like to use NOTICE log level for SiteEncrypt messages and this PR should allow that. I'm not sure when if Logger.levels/0 was available in Elixir v1.10, but I'll try to find out.


Seems to be available only since v1.16.0 https://hexdocs.pm/logger/1.17.0/Logger.html#levels/0, I'll hardcode it then.


The extended log levels were made available in v1.11.0 https://hexdocs.pm/logger/1.11.0/Logger.html#module-levels

Comment on lines 50 to 56
log_levels =
if Version.compare(System.version(), "1.11.0") in [:gt, :eq] do
[:error, :info, :debug, :emergency, :alert, :critical, :warning, :notice]
else
[:debug, :info, :warn, :error]
end

Copy link
Owner

Choose a reason for hiding this comment

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

I don't think there's need for these version gymnastics. I propose we use Logger.levels/0, but we should then change mix.exs and require 1.16+. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👋 @sasa1977

Of course I prefer this :)

I just didn't think it was appropriate to ask for dropping support for old Elixir versions just to support my little feature request.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll update the PR in the next few minutes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ruslandoga ruslandoga requested a review from sasa1977 June 19, 2024 04:44
@sasa1977 sasa1977 merged commit 792396d into sasa1977:master Jun 19, 2024
1 check failed
@sasa1977
Copy link
Owner

Thank you!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants