Skip to content

Commit 3a3b8fb

Browse files
InterLinked1Friendly Automation
authored and
Friendly Automation
committed
channel.c: Clean up debug level 1.
Although there are 10 debugs levels, over time, many current debug calls have come to use inappropriately low debug levels. In particular, a select few debug calls (currently all debug 1) can result in thousands of debug messages per minute for a single call. This can adds a lot of noise to core debug which dilutes the value in having different debug levels in the first place, as these log messages are from the core internals are are better suited for higher debug levels. Some debugs levels are thus adjusted so that debug level 1 is not inappropriately overloaded with these extremely high-volume and general debug messages. ASTERISK-29897 #close Change-Id: I55a71598993552d3d64a401a35ee99474770d4b4
1 parent 2ba5da1 commit 3a3b8fb

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

main/audiohook.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,17 @@ int ast_audiohook_write_frame(struct ast_audiohook *audiohook, enum ast_audiohoo
168168
other_factory_ms = other_factory_samples / (audiohook->hook_internal_samp_rate / 1000);
169169

170170
if (ast_test_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC) && (our_factory_ms - other_factory_ms > AST_AUDIOHOOK_SYNC_TOLERANCE)) {
171-
ast_debug(1, "Flushing audiohook %p so it remains in sync\n", audiohook);
171+
ast_debug(4, "Flushing audiohook %p so it remains in sync\n", audiohook);
172172
ast_slinfactory_flush(factory);
173173
ast_slinfactory_flush(other_factory);
174174
}
175175

176176
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))) {
177-
ast_debug(1, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook);
177+
ast_debug(4, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook);
178178
ast_slinfactory_flush(factory);
179179
ast_slinfactory_flush(other_factory);
180180
} else if ((our_factory_ms > AST_AUDIOHOOK_LONG_QUEUE_TOLERANCE) || (other_factory_ms > AST_AUDIOHOOK_LONG_QUEUE_TOLERANCE)) {
181-
ast_debug(1, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook);
181+
ast_debug(4, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook);
182182
ast_slinfactory_flush(factory);
183183
ast_slinfactory_flush(other_factory);
184184
}
@@ -254,7 +254,7 @@ static struct ast_frame *audiohook_read_frame_both(struct ast_audiohook *audioho
254254

255255
if (!usable_read && !usable_write) {
256256
/* If both factories are unusable bail out */
257-
ast_debug(1, "Read factory %p and write factory %p both fail to provide %zu samples\n", &audiohook->read_factory, &audiohook->write_factory, samples);
257+
ast_debug(3, "Read factory %p and write factory %p both fail to provide %zu samples\n", &audiohook->read_factory, &audiohook->write_factory, samples);
258258
return NULL;
259259
}
260260

@@ -315,7 +315,7 @@ static struct ast_frame *audiohook_read_frame_both(struct ast_audiohook *audioho
315315
}
316316
}
317317
} else {
318-
ast_debug(1, "Failed to get %d samples from write factory %p\n", (int)samples, &audiohook->write_factory);
318+
ast_debug(3, "Failed to get %d samples from write factory %p\n", (int)samples, &audiohook->write_factory);
319319
}
320320

321321
frame.subclass.format = ast_format_cache_get_slin_by_rate(audiohook->hook_internal_samp_rate);

main/channel.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -3204,7 +3204,7 @@ int ast_settimeout_full(struct ast_channel *c, unsigned int rate, int (*func)(co
32043204
real_rate = max_rate;
32053205
}
32063206

3207-
ast_debug(1, "Scheduling timer at (%u requested / %u actual) timer ticks per second\n", rate, real_rate);
3207+
ast_debug(3, "Scheduling timer at (%u requested / %u actual) timer ticks per second\n", rate, real_rate);
32083208

32093209
res = ast_timer_set_rate(ast_channel_timer(c), real_rate);
32103210

@@ -5039,7 +5039,7 @@ int ast_prod(struct ast_channel *chan)
50395039

50405040
/* Send an empty audio frame to get things moving */
50415041
if (ast_channel_state(chan) != AST_STATE_UP) {
5042-
ast_debug(1, "Prodding channel '%s'\n", ast_channel_name(chan));
5042+
ast_debug(3, "Prodding channel '%s'\n", ast_channel_name(chan));
50435043
a.subclass.format = ast_channel_rawwriteformat(chan);
50445044
a.data.ptr = nothing + AST_FRIENDLY_OFFSET;
50455045
a.src = "ast_prod"; /* this better match check in ast_write */

0 commit comments

Comments
 (0)