Przeglądaj źródła

Merge pull request #368 from artemeff/suppress-suprevisors

Add config for suppress supervisors start/stop
pull/302/merge
Mark Allen 8 lat temu
committed by GitHub
rodzic
commit
a1f1e625a0
2 zmienionych plików z 19 dodań i 4 usunięć
  1. +10
    -0
      README.md
  2. +9
    -4
      src/error_logger_lager_h.erl

+ 10
- 0
README.md Wyświetl plik

@ -652,6 +652,16 @@ You can also pass it to `erlc`, if you prefer:
erlc -pa lager/ebin +'{parse_transform, lager_transform}' +'{lager_truncation_size, 1024}' file.erl
```
Suppress applications and supervisors start/stop logs
-----------------------------------------------------
If you don't want to see supervisors and applications start/stop logs in debug level of your application, you can use these configs to turn it off:
```erlang
{lager, [{suppress_application_start_stop, true},
{suppress_supervisor_start_stop, true}]}
```
3.x Changelog
-------------
3.2.2 - 22 September 2016

+ 9
- 4
src/error_logger_lager_h.erl Wyświetl plik

@ -263,10 +263,15 @@ log_event(Event, #state{sink=Sink} = State) ->
[App, Node])
end;
[{started, Started}, {supervisor, Name}] ->
MFA = format_mfa(get_value(mfargs, Started)),
Pid = get_value(pid, Started),
?LOGFMT(Sink, debug, P, "Supervisor ~w started ~s at pid ~w",
[supervisor_name(Name), MFA, Pid]);
case lager_app:get_env(lager, suppress_supervisor_start_stop, false) of
true ->
ok;
_ ->
MFA = format_mfa(get_value(mfargs, Started)),
Pid = get_value(pid, Started),
?LOGFMT(Sink, debug, P, "Supervisor ~w started ~s at pid ~w",
[supervisor_name(Name), MFA, Pid])
end;
_ ->
?LOGMSG(Sink, info, P, "PROGRESS REPORT " ++ print_silly_list(D))
end;

Ładowanie…
Anuluj
Zapisz