[asterisk-commits] logger: Always enable verbose for console channel. (asterisk[14.0])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 21 12:59:19 CDT 2016


Joshua Colp has submitted this change and it was merged.

Change subject: logger: Always enable verbose for console channel.
......................................................................


logger: Always enable verbose for console channel.

Previous versions of Asterisk did not require verbose to be specified in
logger.conf for the console channel, if it was requested by command line
or asterisk.conf it just worked.  This change causes Asterisk to always
enable verbose in the console channel level mask.  Verbose is displayed
on consoles if requested by command line, option_verbose or 'core set
verbose'.

This also delays initialization of the logger until after threadstorage
is initialized.  Initializing too early can cause messages to be printed
multiple times to the console (stdout).

ASTERISK-26391 #close

Change-Id: I52187d67c2fcb3efd5561bf04b3e5e23e5ee8a04
---
M main/asterisk.c
M main/logger.c
2 files changed, 8 insertions(+), 6 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved
  Joshua Colp: Looks good to me, but someone else must approve; Verified



diff --git a/main/asterisk.c b/main/asterisk.c
index 850003b..59fb333 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -4454,11 +4454,6 @@
 
 	aco_init();
 
-	if (init_logger()) {		/* Start logging subsystem */
-		printf("Failed: init_logger\n%s", term_quit());
-		exit(1);
-	}
-
 	if (ast_bucket_init()) {
 		printf("Failed: ast_bucket_init\n%s", term_quit());
 		exit(1);
@@ -4503,6 +4498,11 @@
 
 	threadstorage_init();
 
+	if (init_logger()) {		/* Start logging subsystem */
+		printf("Failed: init_logger\n%s", term_quit());
+		exit(1);
+	}
+
 	if (ast_rtp_engine_init()) {
 		printf("Failed: ast_rtp_engine_init\n%s", term_quit());
 		exit(1);
diff --git a/main/logger.c b/main/logger.c
index db3d7a7..315de9f 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -479,6 +479,7 @@
 		 * with calculating the ast_verb_sys_level value.
 		 */
 		chan->verbosity = -1;
+		logmask |= (1 << __LOG_VERBOSE);
 	} else {
 		chan->verbosity = verb_level;
 	}
@@ -663,7 +664,8 @@
 			return -1;
 		}
 		chan->type = LOGTYPE_CONSOLE;
-		chan->logmask = (1 << __LOG_WARNING) | (1 << __LOG_NOTICE) | (1 << __LOG_ERROR);
+		chan->logmask = (1 << __LOG_WARNING) | (1 << __LOG_NOTICE) | (1 << __LOG_ERROR)
+			| (1 << __LOG_VERBOSE);
 		memcpy(&chan->formatter, &logformatter_default, sizeof(chan->formatter));
 
 		AST_RWLIST_INSERT_HEAD(&logchannels, chan, list);

-- 
To view, visit https://gerrit.asterisk.org/3941
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I52187d67c2fcb3efd5561bf04b3e5e23e5ee8a04
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14.0
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-commits mailing list