aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_logs.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2011-09-23 17:14:03 +0200
committerPeter Andersson <[email protected]>2011-09-23 17:14:03 +0200
commitb2a37fbc00f29ee6208b0f02b36e9d2f919ecef7 (patch)
tree9b6bfb243ba38a796142b1a500cddf272c3572f4 /lib/common_test/src/ct_logs.erl
parent22feee99b91818456ee2fcb70fb065b4dee0536e (diff)
downloadotp-b2a37fbc00f29ee6208b0f02b36e9d2f919ecef7.tar.gz
otp-b2a37fbc00f29ee6208b0f02b36e9d2f919ecef7.tar.bz2
otp-b2a37fbc00f29ee6208b0f02b36e9d2f919ecef7.zip
Enhance logging performance
OTP-9575
Diffstat (limited to 'lib/common_test/src/ct_logs.erl')
-rw-r--r--lib/common_test/src/ct_logs.erl17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl
index 0580a814c4..3798f26f7b 100644
--- a/lib/common_test/src/ct_logs.erl
+++ b/lib/common_test/src/ct_logs.erl
@@ -28,7 +28,7 @@
-module(ct_logs).
--export([init/1,close/2,init_tc/0,end_tc/1]).
+-export([init/1,close/2,init_tc/1,end_tc/1]).
-export([get_log_dir/0,log/3,start_log/1,cont_log/2,end_log/0]).
-export([set_stylesheet/2,clear_stylesheet/1]).
-export([add_external_logs/1,add_link/3]).
@@ -197,15 +197,14 @@ cast(Msg) ->
?MODULE ! Msg
end.
-
%%%-----------------------------------------------------------------
-%%% @spec init_tc() -> ok
+%%% @spec init_tc(RefreshLog) -> ok
%%%
%%% @doc Test case initiation (tool-internal use only).
%%%
%%% <p>This function is called by ct_framework:init_tc/3</p>
-init_tc() ->
- call({init_tc,self(),group_leader()}),
+init_tc(RefreshLog) ->
+ call({init_tc,self(),group_leader(),RefreshLog}),
ok.
%%%-----------------------------------------------------------------
@@ -505,11 +504,15 @@ logger_loop(State) ->
[begin io:format(Fd,Str,Args),io:nl(Fd) end || {Str,Args} <- List],
logger_loop(State#logger_state{tc_groupleaders=TCGLs})
end;
- {{init_tc,TCPid,GL},From} ->
+ {{init_tc,TCPid,GL,RefreshLog},From} ->
print_style(GL, State#logger_state.stylesheet),
set_evmgr_gl(GL),
TCGLs = add_tc_gl(TCPid,GL,State),
- make_last_run_index(State#logger_state.start_time),
+ if not RefreshLog ->
+ ok;
+ true ->
+ make_last_run_index(State#logger_state.start_time)
+ end,
return(From,ok),
logger_loop(State#logger_state{tc_groupleaders=TCGLs});
{{end_tc,TCPid},From} ->