<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18088">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  Friendly Automation: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">channel.c: Clean up debug level 1.<br><br>Although there are 10 debugs levels, over time,<br>many current debug calls have come to use<br>inappropriately low debug levels. In particular,<br>a select few debug calls (currently all debug 1)<br>can result in thousands of debug messages per minute<br>for a single call.<br><br>This can adds a lot of noise to core debug<br>which dilutes the value in having different<br>debug levels in the first place, as these<br>log messages are from the core internals are<br>are better suited for higher debug levels.<br><br>Some debugs levels are thus adjusted so that<br>debug level 1 is not inappropriately overloaded<br>with these extremely high-volume and general<br>debug messages.<br><br>ASTERISK-29897 #close<br><br>Change-Id: I55a71598993552d3d64a401a35ee99474770d4b4<br>---<br>M main/audiohook.c<br>M main/channel.c<br>2 files changed, 7 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/audiohook.c b/main/audiohook.c</span><br><span>index 2278e5e..966d5f2 100644</span><br><span>--- a/main/audiohook.c</span><br><span>+++ b/main/audiohook.c</span><br><span>@@ -168,17 +168,17 @@</span><br><span>   other_factory_ms = other_factory_samples / (audiohook->hook_internal_samp_rate / 1000);</span><br><span> </span><br><span>       if (ast_test_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC) && (our_factory_ms - other_factory_ms > AST_AUDIOHOOK_SYNC_TOLERANCE)) {</span><br><span style="color: hsl(0, 100%, 40%);">-            ast_debug(1, "Flushing audiohook %p so it remains in sync\n", audiohook);</span><br><span style="color: hsl(120, 100%, 40%);">+           ast_debug(4, "Flushing audiohook %p so it remains in sync\n", audiohook);</span><br><span>          ast_slinfactory_flush(factory);</span><br><span>              ast_slinfactory_flush(other_factory);</span><br><span>        }</span><br><span> </span><br><span>        if (ast_test_flag(audiohook, AST_AUDIOHOOK_SMALL_QUEUE) && ((our_factory_ms > AST_AUDIOHOOK_SMALL_QUEUE_TOLERANCE) || (other_factory_ms > AST_AUDIOHOOK_SMALL_QUEUE_TOLERANCE))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                ast_debug(1, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook);</span><br><span style="color: hsl(120, 100%, 40%);">+             ast_debug(4, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook);</span><br><span>            ast_slinfactory_flush(factory);</span><br><span>              ast_slinfactory_flush(other_factory);</span><br><span>        } else if ((our_factory_ms > AST_AUDIOHOOK_LONG_QUEUE_TOLERANCE) || (other_factory_ms > AST_AUDIOHOOK_LONG_QUEUE_TOLERANCE)) {</span><br><span style="color: hsl(0, 100%, 40%);">-            ast_debug(1, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook);</span><br><span style="color: hsl(120, 100%, 40%);">+             ast_debug(4, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook);</span><br><span>            ast_slinfactory_flush(factory);</span><br><span>              ast_slinfactory_flush(other_factory);</span><br><span>        }</span><br><span>@@ -254,7 +254,7 @@</span><br><span> </span><br><span>  if (!usable_read && !usable_write) {</span><br><span>                 /* If both factories are unusable bail out */</span><br><span style="color: hsl(0, 100%, 40%);">-           ast_debug(1, "Read factory %p and write factory %p both fail to provide %zu samples\n", &audiohook->read_factory, &audiohook->write_factory, samples);</span><br><span style="color: hsl(120, 100%, 40%);">+                ast_debug(3, "Read factory %p and write factory %p both fail to provide %zu samples\n", &audiohook->read_factory, &audiohook->write_factory, samples);</span><br><span>               return NULL;</span><br><span>         }</span><br><span> </span><br><span>@@ -315,7 +315,7 @@</span><br><span>                  }</span><br><span>            }</span><br><span>    } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                ast_debug(1, "Failed to get %d samples from write factory %p\n", (int)samples, &audiohook->write_factory);</span><br><span style="color: hsl(120, 100%, 40%);">+           ast_debug(3, "Failed to get %d samples from write factory %p\n", (int)samples, &audiohook->write_factory);</span><br><span>  }</span><br><span> </span><br><span>        frame.subclass.format = ast_format_cache_get_slin_by_rate(audiohook->hook_internal_samp_rate);</span><br><span>diff --git a/main/channel.c b/main/channel.c</span><br><span>index 3428e3a..8e1c629 100644</span><br><span>--- a/main/channel.c</span><br><span>+++ b/main/channel.c</span><br><span>@@ -3204,7 +3204,7 @@</span><br><span>               real_rate = max_rate;</span><br><span>        }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   ast_debug(1, "Scheduling timer at (%u requested / %u actual) timer ticks per second\n", rate, real_rate);</span><br><span style="color: hsl(120, 100%, 40%);">+   ast_debug(3, "Scheduling timer at (%u requested / %u actual) timer ticks per second\n", rate, real_rate);</span><br><span> </span><br><span>      res = ast_timer_set_rate(ast_channel_timer(c), real_rate);</span><br><span> </span><br><span>@@ -5039,7 +5039,7 @@</span><br><span> </span><br><span>   /* Send an empty audio frame to get things moving */</span><br><span>         if (ast_channel_state(chan) != AST_STATE_UP) {</span><br><span style="color: hsl(0, 100%, 40%);">-          ast_debug(1, "Prodding channel '%s'\n", ast_channel_name(chan));</span><br><span style="color: hsl(120, 100%, 40%);">+            ast_debug(3, "Prodding channel '%s'\n", ast_channel_name(chan));</span><br><span>           a.subclass.format = ast_channel_rawwriteformat(chan);</span><br><span>                a.data.ptr = nothing + AST_FRIENDLY_OFFSET;</span><br><span>          a.src = "ast_prod"; /* this better match check in ast_write */</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18088">change 18088</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/+/18088"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: I55a71598993552d3d64a401a35ee99474770d4b4 </div>
<div style="display:none"> Gerrit-Change-Number: 18088 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </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-MessageType: merged </div>