aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/error_logger_warn_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kernel/test/error_logger_warn_SUITE.erl')
-rw-r--r--lib/kernel/test/error_logger_warn_SUITE.erl502
1 files changed, 257 insertions, 245 deletions
diff --git a/lib/kernel/test/error_logger_warn_SUITE.erl b/lib/kernel/test/error_logger_warn_SUITE.erl
index 2bf467610e..a3a3b2f8c6 100644
--- a/lib/kernel/test/error_logger_warn_SUITE.erl
+++ b/lib/kernel/test/error_logger_warn_SUITE.erl
@@ -3,16 +3,17 @@
%%
%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
%%
%% %CopyrightEnd%
%%
@@ -21,8 +22,8 @@
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
init_per_testcase/2,end_per_testcase/2,
- basic/1,warnings_info/1,warnings_warnings/1,
- rb_basic/1,rb_warnings_info/1,rb_warnings_warnings/1,
+ basic/1,warnings_info/1,warnings_errors/1,
+ rb_basic/1,rb_warnings_info/1,rb_warnings_errors/1,
rb_trunc/1,rb_utc/1,file_utc/1]).
%% Internal exports.
@@ -48,8 +49,8 @@
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [basic, warnings_info, warnings_warnings, rb_basic,
- rb_warnings_info, rb_warnings_warnings, rb_trunc,
+ [basic, warnings_info, warnings_errors, rb_basic,
+ rb_warnings_info, rb_warnings_errors, rb_trunc,
rb_utc, file_utc].
groups() ->
@@ -69,7 +70,7 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?default_timeout),
+ Dog = ?t:timetrap(?default_timeout),
[{watchdog, Dog} | Config].
end_per_testcase(_Case, Config) ->
Dog = ?config(watchdog, Config),
@@ -88,11 +89,11 @@ warnings_info(Config) when is_list(Config) ->
put(elw_config,Config),
warnings_info().
-warnings_warnings(doc) ->
- ["Tests mapping warnings to warnings functionality"];
-warnings_warnings(Config) when is_list(Config) ->
+warnings_errors(doc) ->
+ ["Tests mapping warnings to errors functionality"];
+warnings_errors(Config) when is_list(Config) ->
put(elw_config,Config),
- warnings_warnings().
+ warnings_errors().
rb_basic(doc) ->
["Tests basic rb functionality"];
@@ -106,11 +107,11 @@ rb_warnings_info(Config) when is_list(Config) ->
put(elw_config,Config),
rb_warnings_info().
-rb_warnings_warnings(doc) ->
- ["Tests warnings as warnings rb functionality"];
-rb_warnings_warnings(Config) when is_list(Config) ->
+rb_warnings_errors(doc) ->
+ ["Tests warnings as errors rb functionality"];
+rb_warnings_errors(Config) when is_list(Config) ->
put(elw_config,Config),
- rb_warnings_warnings().
+ rb_warnings_errors().
rb_trunc(doc) ->
["Tests rb functionality on truncated data"];
@@ -159,6 +160,9 @@ install_relay(Node) ->
rpc:call(Node,error_logger,add_report_handler,[?MODULE,[self()]]).
+warning_map(Node) ->
+ rpc:call(Node,error_logger,warning_map,[]).
+
format(Node,A,B) ->
rpc:call(Node,error_logger,format,[A,B]).
error_msg(Node,A,B) ->
@@ -181,80 +185,81 @@ nn() ->
basic() ->
- ?line Node = start_node(nn(),[]),
- ?line ok = install_relay(Node),
- ?line Self = self(),
- ?line GL = group_leader(),
- ?line format(Node,"~p~n",[Self]),
- ?line ?EXPECT({handle_event,{error,GL,{_,"~p~n",[Self]}}}),
- ?line error_msg(Node,"~p~n",[Self]),
- ?line ?EXPECT({handle_event,{error,GL,{_,"~p~n",[Self]}}}),
- ?line warning_msg(Node,"~p~n",[Self]),
- ?line ?EXPECT({handle_event,{error,GL,{_,"~p~n",[Self]}}}),
- ?line info_msg(Node,"~p~n",[Self]),
- ?line ?EXPECT({handle_event,{info_msg,GL,{_,"~p~n",[Self]}}}),
- ?line Report = [{self,Self},{gl,GL},make_ref()],
- ?line error_report(Node,Report),
- ?line ?EXPECT({handle_event,{error_report,GL,{_,std_error,Report}}}),
- ?line warning_report(Node,Report),
- ?line ?EXPECT({handle_event,{error_report,GL,{_,std_error,Report}}}),
- ?line info_report(Node,Report),
- ?line ?EXPECT({handle_event,{info_report,GL,{_,std_info,Report}}}),
-
- ?line stop_node(Node),
+ Node = start_node(nn(),[]),
+ ok = install_relay(Node),
+ Self = self(),
+ GL = group_leader(),
+ warning = warning_map(Node),
+ format(Node,"~p~n",[Self]),
+ ?EXPECT({handle_event,{error,GL,{_,"~p~n",[Self]}}}),
+ error_msg(Node,"~p~n",[Self]),
+ ?EXPECT({handle_event,{error,GL,{_,"~p~n",[Self]}}}),
+ warning_msg(Node,"~p~n",[Self]),
+ ?EXPECT({handle_event,{warning_msg,GL,{_,"~p~n",[Self]}}}),
+ info_msg(Node,"~p~n",[Self]),
+ ?EXPECT({handle_event,{info_msg,GL,{_,"~p~n",[Self]}}}),
+ Report = [{self,Self},{gl,GL},make_ref()],
+ error_report(Node,Report),
+ ?EXPECT({handle_event,{error_report,GL,{_,std_error,Report}}}),
+ warning_report(Node,Report),
+ ?EXPECT({handle_event,{warning_report,GL,{_,std_warning,Report}}}),
+ info_report(Node,Report),
+ ?EXPECT({handle_event,{info_report,GL,{_,std_info,Report}}}),
+ stop_node(Node),
ok.
warnings_info() ->
- ?line Node = start_node(nn(),"+Wi"),
- ?line ok = install_relay(Node),
- ?line Self = self(),
- ?line GL = group_leader(),
- ?line Report = [{self,Self},{gl,GL},make_ref()],
- ?line warning_msg(Node,"~p~n",[Self]),
- ?line ?EXPECT({handle_event,{info_msg,GL,{_,"~p~n",[Self]}}}),
- ?line warning_report(Node,Report),
- ?line ?EXPECT({handle_event,{info_report,GL,{_,std_info,Report}}}),
- ?line stop_node(Node),
+ Node = start_node(nn(),"+Wi"),
+ ok = install_relay(Node),
+ Self = self(),
+ GL = group_leader(),
+ info = warning_map(Node),
+ Report = [{self,Self},{gl,GL},make_ref()],
+ warning_msg(Node,"~p~n",[Self]),
+ ?EXPECT({handle_event,{info_msg,GL,{_,"~p~n",[Self]}}}),
+ warning_report(Node,Report),
+ ?EXPECT({handle_event,{info_report,GL,{_,std_info,Report}}}),
+ stop_node(Node),
ok.
-warnings_warnings() ->
- ?line Node = start_node(nn(),"+Ww"),
- ?line ok = install_relay(Node),
- ?line Self = self(),
- ?line GL = group_leader(),
- ?line Report = [{self,Self},{gl,GL},make_ref()],
- ?line warning_msg(Node,"~p~n",[Self]),
- ?line ?EXPECT({handle_event,{warning_msg,GL,{_,"~p~n",[Self]}}}),
- ?line warning_report(Node,Report),
- ?line ?EXPECT({handle_event,{warning_report,GL,{_,std_warning,Report}}}),
- ?line stop_node(Node),
+warnings_errors() ->
+ Node = start_node(nn(),"+We"),
+ ok = install_relay(Node),
+ Self = self(),
+ GL = group_leader(),
+ error = warning_map(Node),
+ Report = [{self,Self},{gl,GL},make_ref()],
+ warning_msg(Node,"~p~n",[Self]),
+ ?EXPECT({handle_event,{error,GL,{_,"~p~n",[Self]}}}),
+ warning_report(Node,Report),
+ ?EXPECT({handle_event,{error_report,GL,{_,std_error,Report}}}),
+ stop_node(Node),
ok.
-
-
+
% RB...
quote(String) ->
case os:type() of
- {win32,_} ->
- "\\\""++String++"\\\"";
- _ ->
- "'\""++String++"\"'"
+ {win32,_} ->
+ "\\\""++String++"\\\"";
+ _ ->
+ "'\""++String++"\"'"
end.
iquote(String) ->
case os:type() of
- {win32,_} ->
- "\\\""++String++"\\\"";
- _ ->
- "\""++String++"\""
+ {win32,_} ->
+ "\\\""++String++"\\\"";
+ _ ->
+ "\""++String++"\""
end.
oquote(String) ->
case os:type() of
- {win32,_} ->
- "\""++String++"\"";
- _ ->
- "'"++String++"'"
+ {win32,_} ->
+ "\""++String++"\"";
+ _ ->
+ "'"++String++"'"
end.
@@ -264,18 +269,18 @@ findstr(String,FileName) ->
findstrc(String,File) ->
case string:str(File,String) of
- N when is_integer(N),
- N > 0 ->
- S2 = lists:sublist(File,N,length(File)),
- case string:str(S2,"\n") of
- 0 ->
- 1;
- M ->
- S3 = lists:sublist(S2,M,length(S2)),
- 1 + findstrc(String,S3)
- end;
- _ ->
- 0
+ N when is_integer(N),
+ N > 0 ->
+ S2 = lists:sublist(File,N,length(File)),
+ case string:str(S2,"\n") of
+ 0 ->
+ 1;
+ M ->
+ S3 = lists:sublist(S2,M,length(S2)),
+ 1 + findstrc(String,S3)
+ end;
+ _ ->
+ 0
end.
% Doesn't count empty lines
@@ -349,175 +354,182 @@ one_rb_findstr(Param,String) ->
% Tests
rb_basic() ->
- ?line clean_rd(),
+ clean_rd(),
% Behold, the magic parameters to activate rb logging...
- ?line Node = start_node(nn(),"-boot start_sasl -sasl error_logger_mf_dir "++
- quote(rd())++" error_logger_mf_maxbytes 5000 "
- "error_logger_mf_maxfiles 5"),
- ?line Self = self(),
- ?line GL = group_leader(),
- ?line Report = [{self,Self},{gl,GL},make_ref()],
- ?line fake_gl(Node,warning_msg,"~p~n",[Self]),
- ?line fake_gl(Node,warning_report,Report),
- ?line nice_stop_node(Node),
- ?line application:start(sasl),
- ?line rb:start([{report_dir, rd()}]),
- ?line rb:list(),
- ?line true = (one_rb_lines([error]) > 1),
- ?line true = (one_rb_lines([error_report]) > 1),
- ?line 1 = one_rb_findstr([error],pid_to_list(Self)),
- ?line 1 = one_rb_findstr([error_report],pid_to_list(Self)),
- ?line 2 = one_rb_findstr([],pid_to_list(Self)),
- ?line true = (one_rb_findstr([progress],"===") > 4),
- ?line rb:stop(),
- ?line application:stop(sasl),
- ?line stop_node(Node),
+ Node = start_node(nn(),"-boot start_sasl -sasl error_logger_mf_dir "++
+ quote(rd())++" error_logger_mf_maxbytes 5000 "
+ "error_logger_mf_maxfiles 5"),
+ Self = self(),
+ GL = group_leader(),
+ warning = warning_map(Node),
+ Report = [{self,Self},{gl,GL},make_ref()],
+ fake_gl(Node,warning_msg,"~p~n",[Self]),
+ fake_gl(Node,warning_report,Report),
+ nice_stop_node(Node),
+ application:start(sasl),
+ rb:start([{report_dir, rd()}]),
+ rb:list(),
+ true = (one_rb_lines([error]) =:= 0),
+ true = (one_rb_lines([error_report]) =:= 0),
+ 0 = one_rb_findstr([error],pid_to_list(Self)),
+ 0 = one_rb_findstr([error_report],pid_to_list(Self)),
+ 1 = one_rb_findstr([warning_msg],pid_to_list(Self)),
+ 1 = one_rb_findstr([warning_report],pid_to_list(Self)),
+ 0 = one_rb_findstr([info_msg],pid_to_list(Self)),
+ 0 = one_rb_findstr([info_report],pid_to_list(Self)),
+ 2 = one_rb_findstr([],pid_to_list(Self)),
+ true = (one_rb_findstr([progress],"===") > 4),
+ rb:stop(),
+ application:stop(sasl),
+ stop_node(Node),
ok.
rb_warnings_info() ->
- ?line clean_rd(),
- ?line Node = start_node(nn(),"+W i -boot start_sasl -sasl error_logger_mf_dir "++
- quote(rd())++" error_logger_mf_maxbytes 5000 "
- "error_logger_mf_maxfiles 5"),
- ?line Self = self(),
- ?line GL = group_leader(),
- ?line Report = [{self,Self},{gl,GL},make_ref()],
- ?line fake_gl(Node,warning_msg,"~p~n",[Self]),
- ?line fake_gl(Node,warning_report,Report),
- ?line nice_stop_node(Node),
- ?line application:start(sasl),
- ?line rb:start([{report_dir, rd()}]),
- ?line rb:list(),
- ?line true = (one_rb_lines([error]) =:= 0),
- ?line true = (one_rb_lines([error_report]) =:= 0),
- ?line 0 = one_rb_findstr([error],pid_to_list(Self)),
- ?line 0 = one_rb_findstr([error_report],pid_to_list(Self)),
- ?line 0 = one_rb_findstr([warning_msg],pid_to_list(Self)),
- ?line 0 = one_rb_findstr([warning_report],pid_to_list(Self)),
- ?line 1 = one_rb_findstr([info_msg],pid_to_list(Self)),
- ?line 1 = one_rb_findstr([info_report],pid_to_list(Self)),
- ?line 2 = one_rb_findstr([],pid_to_list(Self)),
- ?line true = (one_rb_findstr([progress],"===") > 4),
- ?line rb:stop(),
- ?line application:stop(sasl),
- ?line stop_node(Node),
+ clean_rd(),
+ Node = start_node(nn(),"+W i -boot start_sasl -sasl error_logger_mf_dir "++
+ quote(rd())++" error_logger_mf_maxbytes 5000 "
+ "error_logger_mf_maxfiles 5"),
+ Self = self(),
+ GL = group_leader(),
+ info = warning_map(Node),
+ Report = [{self,Self},{gl,GL},make_ref()],
+ fake_gl(Node,warning_msg,"~p~n",[Self]),
+ fake_gl(Node,warning_report,Report),
+ nice_stop_node(Node),
+ application:start(sasl),
+ rb:start([{report_dir, rd()}]),
+ rb:list(),
+ true = (one_rb_lines([error]) =:= 0),
+ true = (one_rb_lines([error_report]) =:= 0),
+ 0 = one_rb_findstr([error],pid_to_list(Self)),
+ 0 = one_rb_findstr([error_report],pid_to_list(Self)),
+ 0 = one_rb_findstr([warning_msg],pid_to_list(Self)),
+ 0 = one_rb_findstr([warning_report],pid_to_list(Self)),
+ 1 = one_rb_findstr([info_msg],pid_to_list(Self)),
+ 1 = one_rb_findstr([info_report],pid_to_list(Self)),
+ 2 = one_rb_findstr([],pid_to_list(Self)),
+ true = (one_rb_findstr([progress],"===") > 4),
+ rb:stop(),
+ application:stop(sasl),
+ stop_node(Node),
ok.
-rb_warnings_warnings() ->
- ?line clean_rd(),
- ?line Node = start_node(nn(),"+W w -boot start_sasl -sasl error_logger_mf_dir "++
- quote(rd())++" error_logger_mf_maxbytes 5000 "
- "error_logger_mf_maxfiles 5"),
- ?line Self = self(),
- ?line GL = group_leader(),
- ?line Report = [{self,Self},{gl,GL},make_ref()],
- ?line fake_gl(Node,warning_msg,"~p~n",[Self]),
- ?line fake_gl(Node,warning_report,Report),
- ?line nice_stop_node(Node),
- ?line application:start(sasl),
- ?line rb:start([{report_dir, rd()}]),
- ?line rb:list(),
- ?line true = (one_rb_lines([error]) =:= 0),
- ?line true = (one_rb_lines([error_report]) =:= 0),
- ?line 0 = one_rb_findstr([error],pid_to_list(Self)),
- ?line 0 = one_rb_findstr([error_report],pid_to_list(Self)),
- ?line 1 = one_rb_findstr([warning_msg],pid_to_list(Self)),
- ?line 1 = one_rb_findstr([warning_report],pid_to_list(Self)),
- ?line 0 = one_rb_findstr([info_msg],pid_to_list(Self)),
- ?line 0 = one_rb_findstr([info_report],pid_to_list(Self)),
- ?line 2 = one_rb_findstr([],pid_to_list(Self)),
- ?line true = (one_rb_findstr([progress],"===") > 4),
- ?line rb:stop(),
- ?line application:stop(sasl),
- ?line stop_node(Node),
+rb_warnings_errors() ->
+ clean_rd(),
+ Node = start_node(nn(),"+W e -boot start_sasl -sasl error_logger_mf_dir "++
+ quote(rd())++" error_logger_mf_maxbytes 5000 "
+ "error_logger_mf_maxfiles 5"),
+ Self = self(),
+ GL = group_leader(),
+ error = warning_map(Node),
+ Report = [{self,Self},{gl,GL},make_ref()],
+ fake_gl(Node,warning_msg,"~p~n",[Self]),
+ fake_gl(Node,warning_report,Report),
+ nice_stop_node(Node),
+ application:start(sasl),
+ rb:start([{report_dir, rd()}]),
+ rb:list(),
+ true = (one_rb_lines([error]) > 1),
+ true = (one_rb_lines([error_report]) > 1),
+ 1 = one_rb_findstr([error],pid_to_list(Self)),
+ 1 = one_rb_findstr([error_report],pid_to_list(Self)),
+ 0 = one_rb_findstr([warning_msg],pid_to_list(Self)),
+ 0 = one_rb_findstr([warning_report],pid_to_list(Self)),
+ 0 = one_rb_findstr([info_msg],pid_to_list(Self)),
+ 0 = one_rb_findstr([info_report],pid_to_list(Self)),
+ 2 = one_rb_findstr([],pid_to_list(Self)),
+ true = (one_rb_findstr([progress],"===") > 4),
+ rb:stop(),
+ application:stop(sasl),
+ stop_node(Node),
ok.
rb_trunc() ->
- ?line clean_rd(),
- ?line Node = start_node(nn(),"+W w -boot start_sasl -sasl error_logger_mf_dir "++
- quote(rd())++" error_logger_mf_maxbytes 5000 "
- "error_logger_mf_maxfiles 5"),
- ?line Self = self(),
- ?line GL = group_leader(),
- ?line Report = [{self,Self},{gl,GL},make_ref()],
- ?line fake_gl(Node,warning_msg,"~p~n",[Self]),
- ?line fake_gl(Node,warning_report,Report),
- ?line nice_stop_node(Node),
- ?line application:start(sasl),
- ?line {ok,File} = file:read_file(rf()),
- ?line S=byte_size(File)-2,
- ?line <<TFile:S/binary,_/binary>>=File,
- ?line file:write_file(rf(),TFile),
- ?line rb:start([{report_dir, rd()}]),
- ?line rb:list(),
- ?line true = (one_rb_lines([error]) =:= 0),
- ?line true = (one_rb_lines([error_report]) =:= 0),
- ?line 0 = one_rb_findstr([error],pid_to_list(Self)),
- ?line 0 = one_rb_findstr([error_report],pid_to_list(Self)),
- ?line 1 = one_rb_findstr([warning_msg],pid_to_list(Self)),
- ?line 0 = one_rb_findstr([warning_report],pid_to_list(Self)),
- ?line 0 = one_rb_findstr([info_msg],pid_to_list(Self)),
- ?line 0 = one_rb_findstr([info_report],pid_to_list(Self)),
- ?line 1 = one_rb_findstr([],pid_to_list(Self)),
- ?line true = (one_rb_findstr([progress],"===") > 4),
- ?line rb:stop(),
- ?line application:stop(sasl),
- ?line stop_node(Node),
+ clean_rd(),
+ Node = start_node(nn(),"-boot start_sasl -sasl error_logger_mf_dir "++
+ quote(rd())++" error_logger_mf_maxbytes 5000 "
+ "error_logger_mf_maxfiles 5"),
+ Self = self(),
+ GL = group_leader(),
+ Report = [{self,Self},{gl,GL},make_ref()],
+ fake_gl(Node,warning_msg,"~p~n",[Self]),
+ fake_gl(Node,warning_report,Report),
+ nice_stop_node(Node),
+ application:start(sasl),
+ {ok,File} = file:read_file(rf()),
+ S=byte_size(File)-2,
+ <<TFile:S/binary,_/binary>>=File,
+ file:write_file(rf(),TFile),
+ rb:start([{report_dir, rd()}]),
+ rb:list(),
+ true = (one_rb_lines([error]) =:= 0),
+ true = (one_rb_lines([error_report]) =:= 0),
+ 0 = one_rb_findstr([error],pid_to_list(Self)),
+ 0 = one_rb_findstr([error_report],pid_to_list(Self)),
+ 1 = one_rb_findstr([warning_msg],pid_to_list(Self)),
+ 0 = one_rb_findstr([warning_report],pid_to_list(Self)),
+ 0 = one_rb_findstr([info_msg],pid_to_list(Self)),
+ 0 = one_rb_findstr([info_report],pid_to_list(Self)),
+ 1 = one_rb_findstr([],pid_to_list(Self)),
+ true = (one_rb_findstr([progress],"===") > 4),
+ rb:stop(),
+ application:stop(sasl),
+ stop_node(Node),
ok.
rb_utc() ->
- ?line clean_rd(),
- ?line Node = start_node(nn(),"+W w -boot start_sasl -sasl error_logger_mf_dir "++
- quote(rd())++" error_logger_mf_maxbytes 5000 "
- "error_logger_mf_maxfiles 5 -sasl utc_log true"),
- ?line Self = self(),
- ?line GL = group_leader(),
- ?line Report = [{self,Self},{gl,GL},make_ref()],
- ?line fake_gl(Node,warning_msg,"~p~n",[Self]),
- ?line fake_gl(Node,warning_report,Report),
- ?line nice_stop_node(Node),
- ?line application:stop(sasl),
- ?line UtcLog=case application:get_env(sasl,utc_log) of
- {ok,true} ->
- true;
- _AllOthers ->
- application:set_env(sasl,utc_log,true),
- false
- end,
- ?line application:start(sasl),
- ?line rb:start([{report_dir, rd()}]),
- ?line rb:list(),
- ?line Pr=one_rb_findstr([progress],"==="),
- ?line Wm=one_rb_findstr([warning_msg],"==="),
- ?line Wr=one_rb_findstr([warning_report],"==="),
- ?line Sum=Pr+Wm+Wr,
- ?line Sum=one_rb_findstr([],"UTC"),
- ?line rb:stop(),
- ?line application:stop(sasl),
- ?line application:set_env(sasl,utc_log,UtcLog),
- ?line stop_node(Node),
+ clean_rd(),
+ Node = start_node(nn(),"-boot start_sasl -sasl error_logger_mf_dir "++
+ quote(rd())++" error_logger_mf_maxbytes 5000 "
+ "error_logger_mf_maxfiles 5 -sasl utc_log true"),
+ Self = self(),
+ GL = group_leader(),
+ Report = [{self,Self},{gl,GL},make_ref()],
+ fake_gl(Node,warning_msg,"~p~n",[Self]),
+ fake_gl(Node,warning_report,Report),
+ nice_stop_node(Node),
+ application:stop(sasl),
+ UtcLog=case application:get_env(sasl,utc_log) of
+ {ok,true} ->
+ true;
+ _AllOthers ->
+ application:set_env(sasl,utc_log,true),
+ false
+ end,
+ application:start(sasl),
+ rb:start([{report_dir, rd()}]),
+ rb:list(),
+ Pr=one_rb_findstr([progress],"==="),
+ Wm=one_rb_findstr([warning_msg],"==="),
+ Wr=one_rb_findstr([warning_report],"==="),
+ Sum=Pr+Wm+Wr,
+ Sum=one_rb_findstr([],"UTC"),
+ rb:stop(),
+ application:stop(sasl),
+ application:set_env(sasl,utc_log,UtcLog),
+ stop_node(Node),
ok.
file_utc() ->
- ?line file:delete(lf()),
- ?line SS="+W w -stdlib utc_log true -kernel error_logger "++ oquote("{file,"++iquote(lf())++"}"),
+ file:delete(lf()),
+ SS="-stdlib utc_log true -kernel error_logger "++ oquote("{file,"++iquote(lf())++"}"),
%erlang:display(SS),
- ?line Node = start_node(nn(),SS),
+ Node = start_node(nn(),SS),
%erlang:display(rpc:call(Node,application,get_env,[kernel,error_logger])),
- ?line Self = self(),
- ?line GL = group_leader(),
- ?line fake_gl(Node,error_msg,"~p~n",[Self]),
- ?line fake_gl(Node,warning_msg,"~p~n",[Self]),
- ?line fake_gl(Node,info_msg,"~p~n",[Self]),
- ?line Report = [{self,Self},{gl,GL},make_ref()],
- ?line fake_gl(Node,error_report,Report),
- ?line fake_gl(Node,warning_report,Report),
- ?line fake_gl(Node,info_report,Report),
- ?line nice_stop_node(Node),
- ?line receive after 5000 -> ok end, % Let the node die, needed
- ?line 6 = findstr("UTC",lf()),
- ?line 2 = findstr("WARNING",lf()),
- ?line 2 = findstr("ERROR",lf()),
- ?line 2 = findstr("INFO",lf()),
- ?line stop_node(Node),
+ Self = self(),
+ GL = group_leader(),
+ fake_gl(Node,error_msg,"~p~n",[Self]),
+ fake_gl(Node,warning_msg,"~p~n",[Self]),
+ fake_gl(Node,info_msg,"~p~n",[Self]),
+ Report = [{self,Self},{gl,GL},make_ref()],
+ fake_gl(Node,error_report,Report),
+ fake_gl(Node,warning_report,Report),
+ fake_gl(Node,info_report,Report),
+ nice_stop_node(Node),
+ receive after 5000 -> ok end, % Let the node die, needed
+ 6 = findstr("UTC",lf()),
+ 2 = findstr("WARNING",lf()),
+ 2 = findstr("ERROR",lf()),
+ 2 = findstr("INFO",lf()),
+ stop_node(Node),
ok.