From 441842ce023bf8ef5dc84f2d5061b0b7c79c8130 Mon Sep 17 00:00:00 2001 From: Richard Carlsson Date: Fri, 17 Apr 2015 22:04:31 +0200 Subject: Map error logger warnings to warning messages by default Also fix and document the broken +We option. --- lib/kernel/doc/src/error_logger.xml | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'lib/kernel/doc/src') diff --git a/lib/kernel/doc/src/error_logger.xml b/lib/kernel/doc/src/error_logger.xml index df2f0b01ee..f49d63b5a6 100644 --- a/lib/kernel/doc/src/error_logger.xml +++ b/lib/kernel/doc/src/error_logger.xml @@ -58,12 +58,11 @@ specific events. (add_report_handler/1,2). Also, there is a useful event handler in STDLIB for multi-file logging of events, see log_mf_h(3).

-

Warning events were introduced in Erlang/OTP R9C. To retain - backwards compatibility, these are by default tagged as errors, - thus showing up as error reports in the logs. By using - the command line flag ]]>, they can instead - be tagged as warnings or info. Tagging them as warnings may - require rewriting existing user defined event handlers.

+

Warning events were introduced in Erlang/OTP R9C and are enabled + by default as of 18.0. To retain backwards compatibility with existing + user defined event handlers, these may be tagged as errors or info + using the command line flag ]]>, thus + showing up as error or info reports in the logs.

@@ -132,7 +131,7 @@ ok

Returns the current mapping for warning events. Events sent using warning_msg/1,2 or warning_report/1,2 - are tagged as errors (default), warnings or info, depending + are tagged as errors, warnings (default) or info, depending on the value of the command line flag +W.

 os$ erl
@@ -140,25 +139,25 @@ Erlang (BEAM) emulator version 5.4.8 [hipe] [threads:0] [kernel-poll]
 
 Eshell V5.4.8  (abort with ^G)
 1> error_logger:warning_map().
-error
-2> error_logger:warning_msg("Warnings tagged as: ~p~n", [error]).
+warning
+2> error_logger:warning_msg("Warnings tagged as: ~p~n", [warning]).
 
-=ERROR REPORT==== 11-Aug-2005::15:31:23 ===
-Warnings tagged as: error
+=WARNING REPORT==== 11-Aug-2005::15:31:55 ===
+Warnings tagged as: warning
 ok
 3> 
 User switch command
  --> q
-os$ erl +W w
+os$ erl +W e
 Erlang (BEAM) emulator version 5.4.8 [hipe] [threads:0] [kernel-poll]
 
 Eshell V5.4.8  (abort with ^G)
 1> error_logger:warning_map().
-warning
-2> error_logger:warning_msg("Warnings tagged as: ~p~n", [warning]).
+error
+2> error_logger:warning_msg("Warnings tagged as: ~p~n", [error]).
 
-=WARNING REPORT==== 11-Aug-2005::15:31:55 ===
-Warnings tagged as: warning
+=ERROR REPORT==== 11-Aug-2005::15:31:23 ===
+Warnings tagged as: error
 ok
-- cgit v1.2.3