diff options
author | Micael Karlberg <[email protected]> | 2011-09-26 18:04:52 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-09-26 18:04:52 +0200 |
commit | adacb706e77b90a9284c3f4d8c828992c9acebf8 (patch) | |
tree | b801a4e1f5927642d5379e6be09ddf837ca8672b /lib/common_test/src/ct_logs.erl | |
parent | 3f5c0bf1f17d5c9d6f1b4dad5a9944e844c5393f (diff) | |
parent | 1eb09dda09fa3de6b05f09d881065a0a7de2624f (diff) | |
download | otp-adacb706e77b90a9284c3f4d8c828992c9acebf8.tar.gz otp-adacb706e77b90a9284c3f4d8c828992c9acebf8.tar.bz2 otp-adacb706e77b90a9284c3f4d8c828992c9acebf8.zip |
Merge branch 'major' of super:otp into bmk/inets/inets58_integration
Diffstat (limited to 'lib/common_test/src/ct_logs.erl')
-rw-r--r-- | lib/common_test/src/ct_logs.erl | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl index b839521e24..6a90441d53 100644 --- a/lib/common_test/src/ct_logs.erl +++ b/lib/common_test/src/ct_logs.erl @@ -36,7 +36,7 @@ -export([make_all_suites_index/1,make_all_runs_index/1]). %% Logging stuff directly from testcase --export([tc_log/3,tc_print/3,tc_pal/3, +-export([tc_log/3,tc_print/3,tc_pal/3,ct_log/3, basic_html/0]). %% Simulate logger process for use without ct environment running @@ -360,6 +360,23 @@ tc_pal(Category,Format,Args) -> ok. +%%%----------------------------------------------------------------- +%%% @spec tc_pal(Category,Format,Args) -> ok +%%% Category = atom() +%%% Format = string() +%%% Args = list() +%%% +%%% @doc Print and log to the ct framework log +%%% +%%% <p>This function is called by internal ct functions to +%%% force logging to the ct framework log</p> +ct_log(Category,Format,Args) -> + cast({ct_log,[{div_header(Category),[]}, + {Format,Args}, + {div_footer(),[]}]}), + ok. + + %%%================================================================= %%% Internal functions int_header() -> @@ -516,7 +533,12 @@ logger_loop(State) -> {clear_stylesheet,_} when State#logger_state.stylesheet == undefined -> logger_loop(State); {clear_stylesheet,_} -> - logger_loop(State#logger_state{stylesheet=undefined}); + logger_loop(State#logger_state{stylesheet=undefined}); + {ct_log, List} -> + Fd = State#logger_state.ct_log_fd, + [begin io:format(Fd,Str,Args),io:nl(Fd) end || + {Str,Args} <- List], + logger_loop(State); stop -> io:format(State#logger_state.ct_log_fd, int_header()++int_footer(), |