From 4034b89a07a97766dba5e6213b1eb4d76ba6df9e Mon Sep 17 00:00:00 2001
From: Zandra Hird
Date: Wed, 20 May 2015 15:35:49 +0200
Subject: Revert "Map error logger warnings to warning messages by default"
This reverts commit 4c4d7fa40e5fb59854724ce74b8aa3546525cb90.
This pr is causing some test failures that were missed at first.
---
erts/doc/src/erl.xml | 9 ++--
erts/emulator/beam/erl_init.c | 9 ++--
erts/etc/common/erlexec.c | 2 +-
lib/kernel/doc/src/error_logger.xml | 31 +++++++-------
lib/kernel/test/error_logger_warn_SUITE.erl | 66 ++++++++++++++---------------
5 files changed, 56 insertions(+), 61 deletions(-)
diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml
index 98d05dc7de..ea94a4e82b 100644
--- a/erts/doc/src/erl.xml
+++ b/erts/doc/src/erl.xml
@@ -1322,14 +1322,13 @@
Verbose.
-
+
Sets the mapping of warning messages for .
Messages sent to the error logger using one of the warning
- routines can be mapped either to errors (),
- warnings (), or info reports
- (). The default is warnings.
- The current mapping can be retrieved using
+ routines can be mapped either to errors (default), warnings
+ (), or info reports (). The current
+ mapping can be retrieved using
. See
error_logger(3)
for further information.
diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c
index 33417833a9..988ff0e2b5 100644
--- a/erts/emulator/beam/erl_init.c
+++ b/erts/emulator/beam/erl_init.c
@@ -625,7 +625,7 @@ void erts_usage(void)
erts_fprintf(stderr, "-v turn on chatty mode (GCs will be reported etc)\n");
- erts_fprintf(stderr, "-W set error logger warnings mapping,\n");
+ erts_fprintf(stderr, "-W set error logger warnings mapping,\n");
erts_fprintf(stderr, " see error_logger documentation for details\n");
erts_fprintf(stderr, "-zdbbl size set the distribution buffer busy limit in kilobytes\n");
erts_fprintf(stderr, " valid range is [1-%d]\n", INT_MAX/1024);
@@ -1253,7 +1253,7 @@ erl_start(int argc, char **argv)
verbose = DEBUG_DEFAULT;
#endif
- erts_error_logger_warnings = am_warning;
+ erts_error_logger_warnings = am_error;
while (i < argc) {
if (argv[i][0] != '-') {
@@ -1991,12 +1991,11 @@ erl_start(int argc, char **argv)
case 'i':
erts_error_logger_warnings = am_info;
break;
- case 'e':
- erts_error_logger_warnings = am_error;
- break;
case 'w':
erts_error_logger_warnings = am_warning;
break;
+ case 'e': /* The default */
+ erts_error_logger_warnings = am_error;
default:
erts_fprintf(stderr, "unrecognized warning_map option %s\n", arg);
erts_usage();
diff --git a/erts/etc/common/erlexec.c b/erts/etc/common/erlexec.c
index d6544a2829..23226909a7 100644
--- a/erts/etc/common/erlexec.c
+++ b/erts/etc/common/erlexec.c
@@ -1172,7 +1172,7 @@ usage_aux(void)
"[+S NO_SCHEDULERS:NO_SCHEDULERS_ONLINE] "
"[+SP PERCENTAGE_SCHEDULERS:PERCENTAGE_SCHEDULERS_ONLINE] "
"[+T LEVEL] [+V] [+v] "
- "[+W] [+z MISC_OPTION] [args ...]\n");
+ "[+W] [+z MISC_OPTION] [args ...]\n");
exit(1);
}
diff --git a/lib/kernel/doc/src/error_logger.xml b/lib/kernel/doc/src/error_logger.xml
index f49d63b5a6..df2f0b01ee 100644
--- a/lib/kernel/doc/src/error_logger.xml
+++ b/lib/kernel/doc/src/error_logger.xml
@@ -58,11 +58,12 @@
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 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.
+
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.
@@ -131,7 +132,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, warnings (default) or info, depending
+ are tagged as errors (default), warnings or info, depending
on the value of the command line flag +W.