[Asterisk-code-review] logger: Add custom logging capabilities (asterisk[master])

N A asteriskteam at digium.com
Sun Sep 5 20:45:55 CDT 2021


Attention is currently required from: Joshua Colp, George Joseph, Kevin Harwell.
N A has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/16222 )

Change subject: logger: Add custom logging capabilities
......................................................................


Patch Set 11: Code-Review-1

(2 comments)

Patchset:

PS11: 
I think this is closer to what was desired, but still not quite right.
Asterisk itself registers dynamic levels >= 16, so removing them all during a reload removes the security level, for instance, and it doesn't come back.
Is there any way to do this nicely without a separate global state of what levels are custom (user defined), and only unloading those during the reload?


File main/logger.c:

https://gerrit.asterisk.org/c/asterisk/+/16222/comment/3f9adcca_1fb531a9 
PS10, Line 818: registercustomlevels:;
              : 		while ((logfile = strsep(&customlogs, ","))) {
              : 			unsigned int level;
              : 			/* if we are reloading, we don't want to re-register levels that exist */
              : 			for (level = 16; level < ARRAY_LEN(levels); level++) {
              : 				if (levels[level] && !strcasecmp(levels[level], logfile)) {
              : 					/* need to continue the outer loop, not the inner loop */
              : 					goto registercustomlevels; /* already exists, skip */
              : 				}
              : 			}
              : 			/* Lock already held, so directly register the level */
              : 			logger_register_level(logfile);
              : 		}
> That removes all channels, but does not unregister any levels. […]
Done



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16222
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: If082703cf81a436ae5a565c75225fa8c0554b702
Gerrit-Change-Number: 16222
Gerrit-PatchSet: 11
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: N A <mail at interlinked.x10host.com>
Gerrit-Attention: Joshua Colp <jcolp at sangoma.com>
Gerrit-Attention: George Joseph <gjoseph at digium.com>
Gerrit-Attention: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Mon, 06 Sep 2021 01:45:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: N A <mail at interlinked.x10host.com>
Comment-In-Reply-To: George Joseph <gjoseph at digium.com>
Comment-In-Reply-To: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210905/b0646832/attachment.html>


More information about the asterisk-code-review mailing list