From a0f5a03771e50e1f4a0722373e8823fc72aa5991 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Tue, 16 Apr 2013 14:51:17 +0200 Subject: [common_test] Use max importance when logging errors This commit adds ?MAX_IMPORTANCE to error notifications in the test case log, and it makes sure that the printout says "CT Error Notification". Printouts from cth_log_redirect (sasl and error_reports) uses ?STD_IMPORTANCE and states "System" in the printout. --- lib/common_test/src/ct_logs.erl | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'lib/common_test/src/ct_logs.erl') diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl index 752033fdff..6dce989a88 100644 --- a/lib/common_test/src/ct_logs.erl +++ b/lib/common_test/src/ct_logs.erl @@ -41,7 +41,8 @@ -export([uri/1]). %% Logging stuff directly from testcase --export([tc_log/3, tc_log/4, tc_log_async/3, tc_print/3, tc_print/4, +-export([tc_log/3, tc_log/4, tc_log/5, tc_log_async/3, tc_log_async/5, + tc_print/3, tc_print/4, tc_pal/3, tc_pal/4, ct_log/3, basic_html/0]). %% Simulate logger process for use without ct environment running @@ -333,8 +334,15 @@ tc_log(Category,Format,Args) -> %%%----------------------------------------------------------------- %%% @spec tc_log(Category,Importance,Format,Args) -> ok +%%% @equiv tc_log(Category,Importance,"User",Format,Args) +tc_log(Category,Importance,Format,Args) -> + tc_log(Category,Importance,"User",Format,Args). + +%%%----------------------------------------------------------------- +%%% @spec tc_log(Category,Importance,Printer,Format,Args) -> ok %%% Category = atom() %%% Importance = integer() +%%% Printer = string() %%% Format = string() %%% Args = list() %%% @@ -343,9 +351,6 @@ tc_log(Category,Format,Args) -> %%%

This function is called by ct when logging %%% stuff directly from a testcase (i.e. not from within the CT %%% framework).

-tc_log(Category,Importance,Format,Args) -> - tc_log(Category,Importance,"User",Format,Args). - tc_log(Category,Importance,Printer,Format,Args) -> cast({log,sync,self(),group_leader(),Category,Importance, [{div_header(Category,Printer),[]}, @@ -355,14 +360,15 @@ tc_log(Category,Importance,Printer,Format,Args) -> %%%----------------------------------------------------------------- %%% @spec tc_log_async(Category,Format,Args) -> ok -%%% @equiv tc_log_async(Category,?STD_IMPORTANCE,Format,Args) +%%% @equiv tc_log_async(Category,?STD_IMPORTANCE,"User",Format,Args) tc_log_async(Category,Format,Args) -> - tc_log_async(Category,?STD_IMPORTANCE,Format,Args). + tc_log_async(Category,?STD_IMPORTANCE,"User",Format,Args). %%%----------------------------------------------------------------- %%% @spec tc_log_async(Category,Importance,Format,Args) -> ok %%% Category = atom() %%% Importance = integer() +%%% Printer = string() %%% Format = string() %%% Args = list() %%% @@ -373,9 +379,9 @@ tc_log_async(Category,Format,Args) -> %%% to avoid deadlocks when e.g. the hook that handles SASL printouts %%% prints to the test case log file at the same time test server %%% asks ct_logs for an html wrapper.

-tc_log_async(Category,Importance,Format,Args) -> +tc_log_async(Category,Importance,Printer,Format,Args) -> cast({log,async,self(),group_leader(),Category,Importance, - [{div_header(Category),[]}, + [{div_header(Category,Printer),[]}, {Format,Args}, {div_footer(),[]}]}), ok. -- cgit v1.2.3