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

Give prevalence to process level over primary/module levels #13955

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/logger/lib/logger.ex
Original file line number Diff line number Diff line change
Expand Up @@ -939,8 +939,14 @@ defmodule Logger do
def __should_log__(level, module) do
level = elixir_level_to_erlang_level(level)

if :logger_config.allow(level, module) do
level
case get_process_level(self()) do
v0idpwn marked this conversation as resolved.
Show resolved Hide resolved
nil ->
if :logger_config.allow(level, module) do
level
end

process_level ->
Copy link
Member

Choose a reason for hiding this comment

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

We still need to check if this level is allowed by either calling :logger_config.allow(level) or by calling :logger_config.allow(level, module) if we want still want to look up the module.

Copy link
Contributor Author

@v0idpwn v0idpwn Nov 3, 2024

Choose a reason for hiding this comment

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

Calling :logger_config.allow(level, module) there would give precedence for module/primary level. Pushed some fixes and I believe we have the expected behaviour now :)

process_level
end
end

Expand Down