diff options
author | Siri Hansen <[email protected]> | 2018-06-08 14:20:00 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2018-06-08 14:38:46 +0200 |
commit | c8c1c67d331b5d1ec8cd3cdad5d8231063d7c5d8 (patch) | |
tree | 8b0827e9d741aea9d17dc7c2067258772be4d047 /lib | |
parent | a1c498df4b4ee20172def79c469e6fd8dd41e841 (diff) | |
download | otp-c8c1c67d331b5d1ec8cd3cdad5d8231063d7c5d8.tar.gz otp-c8c1c67d331b5d1ec8cd3cdad5d8231063d7c5d8.tar.bz2 otp-c8c1c67d331b5d1ec8cd3cdad5d8231063d7c5d8.zip |
[logger] Change handler config to accept all levels by default
Diffstat (limited to 'lib')
-rw-r--r-- | lib/kernel/src/logger_server.erl | 2 | ||||
-rw-r--r-- | lib/kernel/test/logger_SUITE.erl | 8 | ||||
-rw-r--r-- | lib/kernel/test/logger_env_var_SUITE.erl | 40 |
3 files changed, 25 insertions, 25 deletions
diff --git a/lib/kernel/src/logger_server.erl b/lib/kernel/src/logger_server.erl index 47010c9fa5..e066837b63 100644 --- a/lib/kernel/src/logger_server.erl +++ b/lib/kernel/src/logger_server.erl @@ -349,7 +349,7 @@ default_config(logger) -> filter_default=>log}; default_config(Id) -> #{id=>Id, - level=>info, + level=>debug, filters=>[], filter_default=>log, formatter=>{?DEFAULT_FORMATTER,#{}}}. diff --git a/lib/kernel/test/logger_SUITE.erl b/lib/kernel/test/logger_SUITE.erl index f7ec59a7b7..a193ae4011 100644 --- a/lib/kernel/test/logger_SUITE.erl +++ b/lib/kernel/test/logger_SUITE.erl @@ -111,7 +111,7 @@ add_remove_handler(_Config) -> [add] = test_server:messages_get(), #{handlers:=Hs} = logger:i(), {value,_,Hs0} = lists:keytake(h1,1,Hs), - {ok,{?MODULE,#{level:=info,filters:=[],filter_default:=log}}} = % defaults + {ok,{?MODULE,#{level:=debug,filters:=[],filter_default:=log}}} = % defaults logger:get_handler_config(h1), ok = logger:set_handler_config(h1,filter_default,stop), [changing_config] = test_server:messages_get(), @@ -209,13 +209,13 @@ add_remove_filter(cleanup,_Config) -> change_config(_Config) -> %% Overwrite handler config - check that defaults are added - ok = logger:add_handler(h1,?MODULE,#{level=>debug,custom=>custom}), - {ok,{?MODULE,#{level:=debug,filter_default:=log,custom:=custom}}} = + ok = logger:add_handler(h1,?MODULE,#{level=>info,custom=>custom}), + {ok,{?MODULE,#{level:=info,filter_default:=log,custom:=custom}}} = logger:get_handler_config(h1), register(callback_receiver,self()), ok = logger:set_handler_config(h1,#{filter_default=>stop}), [changing_config] = test_server:messages_get(), - {ok,{?MODULE,#{level:=info,filter_default:=stop}=C2}} = + {ok,{?MODULE,#{level:=debug,filter_default:=stop}=C2}} = logger:get_handler_config(h1), false = maps:is_key(custom,C2), {error,fail} = logger:set_handler_config(h1,#{conf_call=>fun() -> {error,fail} end}), diff --git a/lib/kernel/test/logger_env_var_SUITE.erl b/lib/kernel/test/logger_env_var_SUITE.erl index be168a264f..ed9e5b795a 100644 --- a/lib/kernel/test/logger_env_var_SUITE.erl +++ b/lib/kernel/test/logger_env_var_SUITE.erl @@ -80,7 +80,7 @@ all() -> default(Config) -> {ok,#{handlers:=Hs},_Node} = setup(Config,[]), {?STANDARD_HANDLER,logger_std_h,StdC} = lists:keyfind(?STANDARD_HANDLER,1,Hs), - info = maps:get(level,StdC), + debug = maps:get(level,StdC), StdFilters = maps:get(filters,StdC), {domain,{_,{log,super,[beam,erlang,otp,sasl]}}} = lists:keyfind(domain,1,StdFilters), @@ -93,7 +93,7 @@ default_sasl_compatible(Config) -> {ok,#{handlers:=Hs},_Node} = setup(Config, [{logger_sasl_compatible,true}]), {?STANDARD_HANDLER,logger_std_h,StdC} = lists:keyfind(?STANDARD_HANDLER,1,Hs), - info = maps:get(level,StdC), + debug = maps:get(level,StdC), StdFilters = maps:get(filters,StdC), {domain,{_,{log,super,[beam,erlang,otp]}}} = lists:keyfind(domain,1,StdFilters), @@ -105,7 +105,7 @@ default_sasl_compatible(Config) -> error_logger_tty(Config) -> {ok,#{handlers:=Hs},_Node} = setup(Config,[{error_logger,tty}]), {?STANDARD_HANDLER,logger_std_h,StdC} = lists:keyfind(?STANDARD_HANDLER,1,Hs), - info = maps:get(level,StdC), + debug = maps:get(level,StdC), StdFilters = maps:get(filters,StdC), {domain,{_,{log,super,[beam,erlang,otp,sasl]}}} = lists:keyfind(domain,1,StdFilters), @@ -119,7 +119,7 @@ error_logger_tty_sasl_compatible(Config) -> [{error_logger,tty}, {logger_sasl_compatible,true}]), {?STANDARD_HANDLER,logger_std_h,StdC} = lists:keyfind(?STANDARD_HANDLER,1,Hs), - info = maps:get(level,StdC), + debug = maps:get(level,StdC), StdFilters = maps:get(filters,StdC), {domain,{_,{log,super,[beam,erlang,otp]}}} = lists:keyfind(domain,1,StdFilters), @@ -135,7 +135,7 @@ error_logger_false(Config) -> {logger_level,notice}]), false = lists:keymember(?STANDARD_HANDLER,1,Hs), {simple,logger_simple_h,SimpleC} = lists:keyfind(simple,1,Hs), - info = maps:get(level,SimpleC), + debug = maps:get(level,SimpleC), notice = maps:get(level,L), SimpleFilters = maps:get(filters,SimpleC), {domain,{_,{log,super,[beam,erlang,otp,sasl]}}} = @@ -152,7 +152,7 @@ error_logger_false_progress(Config) -> {logger_progress_reports,log}]), false = lists:keymember(?STANDARD_HANDLER,1,Hs), {simple,logger_simple_h,SimpleC} = lists:keyfind(simple,1,Hs), - info = maps:get(level,SimpleC), + debug = maps:get(level,SimpleC), notice = maps:get(level,L), SimpleFilters = maps:get(filters,SimpleC), {domain,{_,{log,super,[beam,erlang,otp,sasl]}}} = @@ -169,7 +169,7 @@ error_logger_false_sasl_compatible(Config) -> {logger_sasl_compatible,true}]), false = lists:keymember(?STANDARD_HANDLER,1,Hs), {simple,logger_simple_h,SimpleC} = lists:keyfind(simple,1,Hs), - info = maps:get(level,SimpleC), + debug = maps:get(level,SimpleC), notice = maps:get(level,L), SimpleFilters = maps:get(filters,SimpleC), {domain,{_,{log,super,[beam,erlang,otp]}}} = @@ -218,7 +218,7 @@ logger_file(Config) -> 0),% progress in std logger {?STANDARD_HANDLER,logger_std_h,StdC} = lists:keyfind(?STANDARD_HANDLER,1,Hs), - info = maps:get(level,StdC), + debug = maps:get(level,StdC), StdFilters = maps:get(filters,StdC), {domain,{_,{log,super,[beam,erlang,otp,sasl]}}} = lists:keyfind(domain,1,StdFilters), @@ -241,7 +241,7 @@ logger_file_sasl_compatible(Config) -> 0),% progress in std logger {?STANDARD_HANDLER,logger_std_h,StdC} = lists:keyfind(?STANDARD_HANDLER,1,Hs), - info = maps:get(level,StdC), + debug = maps:get(level,StdC), StdFilters = maps:get(filters,StdC), {domain,{_,{log,super,[beam,erlang,otp]}}} = lists:keyfind(domain,1,StdFilters), @@ -264,7 +264,7 @@ logger_file_log_progress(Config) -> 6),% progress in std logger {?STANDARD_HANDLER,logger_std_h,StdC} = lists:keyfind(?STANDARD_HANDLER,1,Hs), - info = maps:get(level,StdC), + debug = maps:get(level,StdC), StdFilters = maps:get(filters,StdC), {domain,{_,{log,super,[beam,erlang,otp,sasl]}}} = lists:keyfind(domain,1,StdFilters), @@ -287,7 +287,7 @@ logger_file_no_filter(Config) -> 6),% progress in std logger {?STANDARD_HANDLER,logger_std_h,StdC} = lists:keyfind(?STANDARD_HANDLER,1,Hs), - info = maps:get(level,StdC), + debug = maps:get(level,StdC), [] = maps:get(filters,StdC), false = lists:keymember(simple,1,Hs), false = lists:keymember(sasl,1,Hs), @@ -329,7 +329,7 @@ logger_file_formatter(Config) -> 6),% progress in std logger {?STANDARD_HANDLER,logger_std_h,StdC} = lists:keyfind(?STANDARD_HANDLER,1,Hs), - info = maps:get(level,StdC), + debug = maps:get(level,StdC), [] = maps:get(filters,StdC), false = lists:keymember(simple,1,Hs), false = lists:keymember(sasl,1,Hs), @@ -351,7 +351,7 @@ logger_filters(Config) -> 0),% progress in std logger {?STANDARD_HANDLER,logger_std_h,StdC} = lists:keyfind(?STANDARD_HANDLER,1,Hs), - info = maps:get(level,StdC), + debug = maps:get(level,StdC), StdFilters = maps:get(filters,StdC), {domain,{_,{log,super,[beam,erlang,otp,sasl]}}} = lists:keyfind(domain,1,StdFilters), @@ -376,11 +376,11 @@ logger_filters_stop(Config) -> ]}]), check_default_log(Node,Log, file,% dest - 0, - notice),% progress in std logger + 0,% progress in std logger + notice), {?STANDARD_HANDLER,logger_std_h,StdC} = lists:keyfind(?STANDARD_HANDLER,1,Hs), - info = maps:get(level,StdC), + debug = maps:get(level,StdC), [] = maps:get(filters,StdC), false = lists:keymember(simple,1,Hs), false = lists:keymember(sasl,1,Hs), @@ -404,7 +404,7 @@ logger_module_level(Config) -> 3),% progress in std logger {?STANDARD_HANDLER,logger_std_h,StdC} = lists:keyfind(?STANDARD_HANDLER,1,Hs), - info = maps:get(level,StdC), + debug = maps:get(level,StdC), StdFilters = maps:get(filters,StdC), {domain,{_,{log,super,[beam,erlang,otp,sasl]}}} = lists:keyfind(domain,1,StdFilters), @@ -426,7 +426,7 @@ logger_disk_log(Config) -> 0),% progress in std logger {?STANDARD_HANDLER,logger_disk_log_h,StdC} = lists:keyfind(?STANDARD_HANDLER,1,Hs), - info = maps:get(level,StdC), + debug = maps:get(level,StdC), StdFilters = maps:get(filters,StdC), {domain,{_,{log,super,[beam,erlang,otp,sasl]}}} = lists:keyfind(domain,1,StdFilters), @@ -450,7 +450,7 @@ logger_disk_log_formatter(Config) -> 6),% progress in std logger {?STANDARD_HANDLER,logger_disk_log_h,StdC} = lists:keyfind(?STANDARD_HANDLER,1,Hs), - info = maps:get(level,StdC), + debug = maps:get(level,StdC), [] = maps:get(filters,StdC), false = lists:keymember(simple,1,Hs), false = lists:keymember(sasl,1,Hs), @@ -462,7 +462,7 @@ logger_undefined(Config) -> setup(Config,[{logger,[{handler,?STANDARD_HANDLER,undefined}]}]), false = lists:keymember(?STANDARD_HANDLER,1,Hs), {simple,logger_simple_h,SimpleC} = lists:keyfind(simple,1,Hs), - info = maps:get(level,SimpleC), + debug = maps:get(level,SimpleC), info = maps:get(level,L), SimpleFilters = maps:get(filters,SimpleC), {domain,{_,{log,super,[beam,erlang,otp,sasl]}}} = |