[asterisk-commits] russell: branch 10 r359260 - in /branches/10: ./ include/asterisk/ main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Mar 14 05:54:52 CDT 2012
Author: russell
Date: Wed Mar 14 05:54:50 2012
New Revision: 359260
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=359260
Log:
Fix bogus reads/writes of console log levels in asterisk.c
This patch updates the NUMLOGLEVELS define in logger.h to 32, to match the fact
that logger.c implements 32 log levels (because of the custom log level stuff).
asterisk.c uses this define to size an array of levels per remote console.
This array is modified in ast_console_toggle_loglevel(), which is called by the
"logger set level" CLI command. While the documentation for the CLI command
doesn't make it terribly obvious, you can use this CLI command to toggle a
custom log level on a remote console, as well. However, doing so led to an
invalid array index in asterisk.c.
This array is read from any time a log message is written to a console. So,
all custom log level messages resulted in a bogus read if a remote console
was connected.
........
Merged revisions 359259 from http://svn.asterisk.org/svn/asterisk/branches/1.8
Modified:
branches/10/ (props changed)
branches/10/include/asterisk/logger.h
branches/10/main/logger.c
Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.
Modified: branches/10/include/asterisk/logger.h
URL: http://svnview.digium.com/svn/asterisk/branches/10/include/asterisk/logger.h?view=diff&rev=359260&r1=359259&r2=359260
==============================================================================
--- branches/10/include/asterisk/logger.h (original)
+++ branches/10/include/asterisk/logger.h Wed Mar 14 05:54:50 2012
@@ -181,7 +181,7 @@
#endif
#define AST_LOG_DTMF __LOG_DTMF, _A_
-#define NUMLOGLEVELS 7
+#define NUMLOGLEVELS 32
/*!
* \brief Get the debug level for a module
Modified: branches/10/main/logger.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/main/logger.c?view=diff&rev=359260&r1=359259&r2=359260
==============================================================================
--- branches/10/main/logger.c (original)
+++ branches/10/main/logger.c Wed Mar 14 05:54:50 2012
@@ -153,7 +153,7 @@
* logchannels list.
*/
-static char *levels[32] = {
+static char *levels[NUMLOGLEVELS] = {
"DEBUG",
"---EVENT---", /* no longer used */
"NOTICE",
@@ -164,7 +164,7 @@
};
/*! \brief Colors used in the console for logging */
-static const int colors[32] = {
+static const int colors[NUMLOGLEVELS] = {
COLOR_BRGREEN,
COLOR_BRBLUE, /* no longer used */
COLOR_YELLOW,
More information about the asterisk-commits
mailing list