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

Kevin Harwell asteriskteam at digium.com
Fri Aug 13 13:31:53 CDT 2021


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

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


Patch Set 7:

(1 comment)

File apps/app_verbose.c:

https://gerrit.asterisk.org/c/asterisk/+/16222/comment/ee564adb_77ab0cbe 
PS6, Line 139: 	} else {
             : 		int level = ast_logger_dynamic_level(args.level);
             : 		if (level > -1) {
             : 			ast_log_dynamic_level(level, "%s\n", args.msg);
             : 		} else {
             : 			ast_log(LOG_ERROR, "Unknown log level: '%s'\n", args.level);
             : 		}
             : 	}
             : 
             : 	if (lnum > -1) {
             : 		snprintf(context, sizeof(context), "@ %s", ast_channel_context(chan));
             : 		snprintf(extension, sizeof(extension), "Ext. %s", ast_channel_exten(chan));
             : 
             : 		ast_log(lnum, extension, ast_channel_priority(chan), context, "%s\n", args.msg);
             : 	}
> Okay, so the way the code is now for this is fine? Or do you want me to have the dynamic level match […]
I personally prefer, and think that the logging of dynamic levels should match, and be logged in the same was as the other ones.

As such using the default logging formatter will only output the extension + text. If someone wants more they can use the plain logging formatter.

The way your patch has it now does not allow for a user to optionally choose to output the extra info.



-- 
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: 7
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Attention: N A <mail at interlinked.x10host.com>
Gerrit-Attention: Joshua Colp <jcolp at sangoma.com>
Gerrit-Comment-Date: Fri, 13 Aug 2021 18:31:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: N A <mail at interlinked.x10host.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/20210813/68284072/attachment.html>


More information about the asterisk-code-review mailing list