Skip to content

Commit

Permalink
Add :all and :none for Logger.level/0 (#13513)
Browse files Browse the repository at this point in the history
According to https://www.erlang.org/doc/man/logger#get_primary_config-0 and https://www.erlang.org/doc/man/logger#type-primary_config,
returned type for `:logger.get_primary_config` is:

```erlang
 #{level => level() | all | none,
   metadata => metadata(),
   filter_default => log | stop,
   filters => [{filter_id(), filter()}]}
```

Thus, inside `Logger.level/0` fun, `level` could also be `all` and `none` when calling:

```elixir
%{level: level} = :logger.get_primary_config()
```
  • Loading branch information
davidjulien committed Apr 26, 2024
1 parent cb9c303 commit c5816a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/logger/lib/logger.ex
Expand Up @@ -604,7 +604,7 @@ defmodule Logger do
The `Logger` level can be changed via `configure/1`.
"""
@spec level() :: level()
@spec level() :: level() | :all | :none
def level() do
%{level: level} = :logger.get_primary_config()

Expand Down

0 comments on commit c5816a2

Please sign in to comment.