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

Here's a suggestion #548

Open
gzkjh opened this issue Mar 23, 2021 · 0 comments
Open

Here's a suggestion #548

gzkjh opened this issue Mar 23, 2021 · 0 comments

Comments

@gzkjh
Copy link

gzkjh commented Mar 23, 2021

Now when I want to add a new level in handlers, for example

{handlers, [
  {lager_file_backend,[
    {file, "xxx.log"}, {level, info}
  ]}
])

This level configuration can be 'notice' '>notice' '=<error' ...etc
But there is no way to write just 'info' and 'notice'
I suggest to modify the lager_util:config_to_levels/1

config_to_levels(Conf = [Lv|_]) when is_atom(Lv) ->
    lists:filter(fun(E)->lists:member(E,Conf) end, levels());

before this code

config_to_levels(Conf)->
    config_to_levels_int(Conf).

After this modification, I can add a level configuration like this

{handlers, [
  {lager_file_backend,[
    {file, "xxx.log"}, {level, [info,notice]}
  ]}
])

It will only record information of type 'info' and 'notice'

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

No branches or pull requests

1 participant