<p>George Joseph <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15211">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Benjamin Keith Ford: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">logger.c: Automatically add a newline to formats that don't have one<br><br>Scope tracing allows you to not specify a format string or<br>variable, in which case it just prints the indent, file,<br>function, and line number. The trace output automatically<br>adds a newline to the end in this case. If you also have<br>debugging turned on for the module, a debug message is<br>also printed but the standard log functionality which<br>prints it doesn't add the newline so you have messages<br>that don't break correctly.<br><br> * format_log_message_ap(), which is the common log<br> message formatter for all channels, now adds a<br> newline to the end of format strings that don't<br> already have a newline.<br><br>ASTERISK-29209<br>Reported by: Alexander Traud<br><br>Change-Id: I994a7df27f88df343b7d19f3e81a4b562d9d41da<br>---<br>M main/logger.c<br>1 file changed, 5 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/logger.c b/main/logger.c</span><br><span>index 067f9a9..5562bf3 100644</span><br><span>--- a/main/logger.c</span><br><span>+++ b/main/logger.c</span><br><span>@@ -1672,6 +1672,11 @@</span><br><span> return NULL;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* Automatically add a newline to format strings that don't have one */</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!ast_ends_with(ast_str_buffer(buf), "\n")) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_str_append(&buf, 0, "\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* Create a new logging message */</span><br><span> if (!(logmsg = ast_calloc_with_stringfields(1, struct logmsg, res + 128))) {</span><br><span> return NULL;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15211">change 15211</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/+/15211"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I994a7df27f88df343b7d19f3e81a4b562d9d41da </div>
<div style="display:none"> Gerrit-Change-Number: 15211 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>