diff options
author | Siri Hansen <[email protected]> | 2019-02-19 17:13:00 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2019-02-19 17:13:00 +0100 |
commit | c14e3dcce779feb3ef254a08acedae60108ad3ac (patch) | |
tree | 8ccb377dfa7a7d286e64a82bfd1c673606845b05 /lib/kernel/test | |
parent | 80b04507b0456a73f2f2f001691cadb4cb3958e8 (diff) | |
parent | e92e76b615590f412aaaa97939d59f266c48da82 (diff) | |
download | otp-c14e3dcce779feb3ef254a08acedae60108ad3ac.tar.gz otp-c14e3dcce779feb3ef254a08acedae60108ad3ac.tar.bz2 otp-c14e3dcce779feb3ef254a08acedae60108ad3ac.zip |
Merge branch 'siri/logger/pretty-print-config/OTP-15600' into maint
* siri/logger/pretty-print-config/OTP-15600:
[logger] Add pretty print function for configuration
Diffstat (limited to 'lib/kernel/test')
-rw-r--r-- | lib/kernel/test/logger_SUITE.erl | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/lib/kernel/test/logger_SUITE.erl b/lib/kernel/test/logger_SUITE.erl index d831d0d108..2dad651f9c 100644 --- a/lib/kernel/test/logger_SUITE.erl +++ b/lib/kernel/test/logger_SUITE.erl @@ -101,7 +101,8 @@ all() -> compare_levels, process_metadata, app_config, - kernel_config]. + kernel_config, + pretty_print]. start_stop(_Config) -> S = whereis(logger), @@ -1141,6 +1142,61 @@ kernel_config(Config) -> ok. +pretty_print(Config) -> + ok = logger:add_handler(?FUNCTION_NAME,logger_std_h,#{}), + ok = logger:set_module_level([module1,module2],debug), + + ct:capture_start(), + logger:i(), + ct:capture_stop(), + I0 = ct:capture_get(), + + ct:capture_start(), + logger:i(primary), + ct:capture_stop(), + IPrim = ct:capture_get(), + + ct:capture_start(), + logger:i(handlers), + ct:capture_stop(), + IHs = ct:capture_get(), + + ct:capture_start(), + logger:i(proxy), + ct:capture_stop(), + IProxy = ct:capture_get(), + + ct:capture_start(), + logger:i(modules), + ct:capture_stop(), + IMs = ct:capture_get(), + + I02 = lists:append([IPrim,IHs,IProxy,IMs]), + %% ct:log("~p~n",[I0]), + %% ct:log("~p~n",[I02]), + I0 = I02, + + ct:capture_start(), + logger:i(handlers), + ct:capture_stop(), + IHs = ct:capture_get(), + + Ids = logger:get_handler_ids(), + IHs2 = + lists:append( + [begin + ct:capture_start(), + logger:i(Id), + ct:capture_stop(), + [_|IH] = ct:capture_get(), + IH + end || Id <- Ids]), + + %% ct:log("~p~n",[IHs]), + %% ct:log("~p~n",[["Handler configuration: \n"|IHs2]]), + IHs = ["Handler configuration: \n"|IHs2], + ok. + %%%----------------------------------------------------------------- %%% Internal check_logged(Level,Format,Args,Meta) -> |