diff options
Diffstat (limited to 'lib/kernel/test/logger_env_var_SUITE.erl')
-rw-r--r-- | lib/kernel/test/logger_env_var_SUITE.erl | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/lib/kernel/test/logger_env_var_SUITE.erl b/lib/kernel/test/logger_env_var_SUITE.erl index e976a10b21..764f443634 100644 --- a/lib/kernel/test/logger_env_var_SUITE.erl +++ b/lib/kernel/test/logger_env_var_SUITE.erl @@ -58,7 +58,8 @@ groups() -> logger_disk_log_formatter, logger_undefined, logger_many_handlers_default_first, - logger_many_handlers_default_last + logger_many_handlers_default_last, + logger_many_handlers_default_last_broken_filter ]}, {bad,[],[bad_error_logger, bad_level, @@ -470,6 +471,8 @@ logger_undefined(Config) -> false = lists:keymember(sasl_h,1,Hs), ok. + +%% Test that we can add multiple handlers with the default first logger_many_handlers_default_first(Config) -> LogErr = file(Config,logger_many_handlers_default_first_error), LogInfo = file(Config,logger_many_handlers_default_first_info), @@ -508,6 +511,28 @@ logger_many_handlers_default_last(Config) -> } ]}], LogErr, LogInfo, 7). +%% Check that we can handle that an added logger has a broken filter +%% This used to cause a deadlock. +logger_many_handlers_default_last_broken_filter(Config) -> + LogErr = file(Config,logger_many_handlers_default_first_broken_filter_error), + LogInfo = file(Config,logger_many_handlers_default_first_broken_filter_info), + + logger_many_handlers( + Config,[{logger, + [{handler,info,logger_std_h, + #{level=>info, + filters=>[{broken,{fun logger_filters:level/2,broken_state}}, + {level,{fun logger_filters:level/2,{stop,gteq,error}}}], + logger_std_h=>#{type=>{file,LogInfo}}} + }, + {handler,?STANDARD_HANDLER,logger_std_h, + #{level=>error, + filters=>[], + formatter=>{logger_formatter,#{}}, + logger_std_h=>#{type=>{file,LogErr}}} + } + ]}], LogErr, LogInfo, 7). + logger_many_handlers(Config, Env, LogErr, LogInfo, NumProgress) -> {ok,#{handlers:=Hs},Node} = setup(Config,Env), check_single_log(Node,LogErr, |