diff options
author | Siri Hansen <[email protected]> | 2018-06-12 14:06:46 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2018-06-12 14:06:46 +0200 |
commit | 465d2849ed0d832577a25a52f0717ec5f7eb94bd (patch) | |
tree | 490304495c0562d34dc4fb7415a64deafd25f470 /lib/sasl/src | |
parent | 0f752d6e9cb447552673bddebccab31539e55358 (diff) | |
parent | 8ae3b6289f25e6c283be5b0d67cd5f6c4434b6e2 (diff) | |
download | otp-465d2849ed0d832577a25a52f0717ec5f7eb94bd.tar.gz otp-465d2849ed0d832577a25a52f0717ec5f7eb94bd.tar.bz2 otp-465d2849ed0d832577a25a52f0717ec5f7eb94bd.zip |
Merge pull request #1835 from sirihansen/siri/logger-fix
Diffstat (limited to 'lib/sasl/src')
-rw-r--r-- | lib/sasl/src/sasl.erl | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/sasl/src/sasl.erl b/lib/sasl/src/sasl.erl index 92b80694d7..5db3d75cfb 100644 --- a/lib/sasl/src/sasl.erl +++ b/lib/sasl/src/sasl.erl @@ -131,6 +131,10 @@ add_sasl_logger(std, undefined) -> ok; add_sasl_logger(Dest, Level) -> FC = #{legacy_header=>true, single_line=>false}, + case Level of + info -> allow_progress(); + _ -> ok + end, ok = logger:add_handler(sasl,logger_std_h, #{level=>Level, filter_default=>stop, @@ -139,8 +143,8 @@ add_sasl_logger(Dest, Level) -> {fun logger_filters:remote_gl/2,stop}}, {sasl_domain, {fun logger_filters:domain/2, - {log,equal,[beam,erlang,otp,sasl]}}}], - logger_std_h=>#{type=>Dest}, + {log,equal,[otp,sasl]}}}], + config=>#{type=>Dest}, formatter=>{logger_formatter,FC}}). delete_sasl_logger(undefined) -> ok; @@ -151,6 +155,7 @@ delete_sasl_logger(_Type) -> add_error_logger_mf(undefined) -> ok; add_error_logger_mf({Dir, MaxB, MaxF}) -> + allow_progress(), error_logger:add_report_handler( log_mf_h, log_mf_h:init(Dir, MaxB, MaxF, fun pred/1)). @@ -161,6 +166,13 @@ delete_error_logger_mf(_) -> pred({_Type, GL, _Msg}) when node(GL) =/= node() -> false; pred(_) -> true. +allow_progress() -> + #{level:=PL} = logger:get_primary_config(), + case logger:compare_levels(info,PL) of + lt -> ok = logger:set_primary_config(level,info); + _ -> ok + end. + %%%----------------------------------------------------------------- %%% supervisor functionality %%%----------------------------------------------------------------- |