Define debug level only for one module/file?

Hi guys!
Recently we created an AEAP service for tts. It works fine. The problem is that our log grow very fast due to

DEBUG[1004] audiohook.c: Read factory 0x7fcf78062a88 and write factory 0x7fcf780634c8 both fail to provide 160 samples
DEBUG[1004] audiohook.c: Write factory 0x7fcf780634c8 was pretty quick last time, waiting for them.

The problem is we cant just set the debug to 0, because there is a debug info that we need to have in our log:

DEBUG[375][C-0000000c] pbx_variables.c: Function SPEECH_TEXT(0) result is ‘01-02-2020’

is it somehow possible to turned off the debug for audiohook.c and keep it for pbx_variables.c?
Or just turned off the audiohook info?
Thanks in advance!

Why do you need that in the log…

Sometimes our clients have issues with the speech recognition, and Function SPEECH_TEXT(0) result is ‘01-02-2020’ is the fastest way to check what asterisk get from our service.

You could also use the Log dialplan application or Verbose to output a specific log message with that information.

Or heck, use NoOp to have a dialplan execution message output.

The debug log isn’t really meant for this.

hi again.
i have found that sometimes speechbackground returns “Function SPEECH_TEXT(0) result is ‘(null)’”, but NoOP returns only empty string (s, 7, NoOp(result speechtext0 ${SPEECH_TEXT(0)})) and we cant ignore the difference since for example (null) happens when the error occurred in our app, but the empty string is just one of the possible results.

Also there are some cases which easy to read with the debug.

So it would be great to just turn the audiohook off. Does asterisk have such option/settings?

To answer your direct question, core set debug 0 then core set debug 5 pbx_variables.c, should do what you want (replace 5 with the desired debug level). You can enable debugging per module or core file this way.

Thanks for the answer! That what i was looking for. Is it possible to set this as an input parameter when we start asterisk or in asterisk.conf?

asterisk.conf allows you to set the global debug level, which isn’t what you want here.

I think the best way might be in cli.conf, just add:

core set debug 5 pbx_variables.c = yes

Thanks for the fast reply! Will try it.

Another question :
i have --ddv as a start param
in asterisk.conf debug level is set to 2
but when i open cli it says Core debug is still 4. Is it possible that something overwrites the debug settings somewhere?

One more:
Is there a command which shows the debug settings, for example, audiohook.c has 0 debug level, pbx_variables.c has 4, etc. Core show settings - doesnt show debug settings.

You would want to do both in your case, yes, since it sounds like your default debug level is not 0.
Alternately in asterisk.conf, set debug = 0.

I don’t think such a command currently exists.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.