<p> Attention is currently required from: N A, Joshua Colp. </p>
<p>Patch set 6:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16222">View Change</a></p><p>3 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="null">File apps/app_verbose.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16222/comment/9c7802ec_800c01d7">Patch Set #6, Line 139:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> } else {<br>              int level = ast_logger_dynamic_level(args.level);<br>             if (level > -1) {<br>                  ast_log_dynamic_level(level, "%s\n", args.msg);<br>             } else {<br>                      ast_log(LOG_ERROR, "Unknown log level: '%s'\n", args.level);<br>                }<br>     }<br><br>   if (lnum > -1) {<br>           snprintf(context, sizeof(context), "@ %s", ast_channel_context(chan));<br>              snprintf(extension, sizeof(extension), "Ext. %s", ast_channel_exten(chan));<br><br>               ast_log(lnum, extension, ast_channel_priority(chan), context, "%s\n", args.msg);<br>    }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Since this is for logging custom levels via the dialplan I think you'd want to log the extension, priority, and context like the other levels do. As such you can simplify this by setting lnum = ast_logger_dynamic_level(args.level) in the 'else' statement, and then moving the (LOG_ERROR, "Unknown ....") to an 'else' off of the 'if (lnum > -1)'</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File configs/samples/logger.conf.sample:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16222/comment/c5c35ab0_2ad8d634">Patch Set #6, Line 92:</a> <code style="font-family:monospace,monospace">;custom_logs</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I'm not a fan of custom_logs. What about dynamic_levels, custom_levels, user_levels or something else?</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File include/asterisk/logger.h:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16222/comment/2680c35b_a78dd58d">Patch Set #6, Line 333:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> * \brief Checks if a dynamic logger level exists<br> * \param name The name of the dynamic level for which to check existence<br> * \retval -1 if no such dynamic level exists<br> * \retval positive log level to be used with ast_log_dynamic_level for sending messages to this level<br> */<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">While this does "check" to me it's more of a retrieval. How about something like the following instead?</p><p style="white-space: pre-wrap; word-wrap: break-word;">\brief "Retrieve dynamic logging level id"<br>\param name The name of the level<br>\retval The unique integer id for the given level<br>\retval -1 if level name not found</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16222">change 16222</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/16222"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: If082703cf81a436ae5a565c75225fa8c0554b702 </div>
<div style="display:none"> Gerrit-Change-Number: 16222 </div>
<div style="display:none"> Gerrit-PatchSet: 6 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Attention: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Attention: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 11 Aug 2021 21:52:41 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>