OpenSER v1.2.0 Configuration Script Debugging

valid for OpenSER v1.2.x

When trying to debug the configuration file of OpenSER might turn out that the amount of debug messages printed is very large and it is hard to spot the lines printed by xlog()/xdbg().

The debug level is controlled by 'debug' global parameter. A higher value make the number of printed message to increase.


debug=7


debug=3 is the usual value for live environments. debug=0 will suppress any debug message but errors or reporting critical situations. So, to debug the script, the value of 'debug' parameter should be higher than 3 (7 ensures that everything is printed out).

To be able to spot certain debug messages, the xlog module gives the functionality of printing colorful messages, via escape sequences. Any unix standard terminal will be able to interpret and display messages highlighted.

$Cxy - reference to an escape sequence. “x” represents the foreground color and “y” represents the background color.

Colors could be:

  • x : default color of the terminal
  • s : Black
  • r : Red
  • g : Green
  • y : Yellow
  • b : Blue
  • p : Purple
  • c : Cyan
  • w : White

Once an escape sequence is printed, next text will be displayed using those foreground and background colors until meeting another escape sequence. It is better to reset it, after the text wanted to be highlighted, via $Cxx, so the terminal gets back to default properties.

Example:

xdbg("$(Cbg)blue on green$(Cxx) default colors $(Cbr)blue on red(Cxx)\n");
# print From URI in red
xdbg("From URI: $(Crx)$fu(Cxx)\n");


See aslo


valid for OpenSER v1.2.x

When trying to debug the configuration file of OpenSER might turn out that the amount of debug messages printed is very large and it is hard to spot the lines printed by xlog()/xdbg().

The debug level is controlled by 'debug' global parameter. A higher value make the number of printed message to increase.


debug=7


debug=3 is the usual value for live environments. debug=0 will suppress any debug message but errors or reporting critical situations. So, to debug the script, the value of 'debug' parameter should be higher than 3 (7 ensures that everything is printed out).

To be able to spot certain debug messages, the xlog module gives the functionality of printing colorful messages, via escape sequences. Any unix standard terminal will be able to interpret and display messages highlighted.

$Cxy - reference to an escape sequence. “x” represents the foreground color and “y” represents the background color.

Colors could be:

  • x : default color of the terminal
  • s : Black
  • r : Red
  • g : Green
  • y : Yellow
  • b : Blue
  • p : Purple
  • c : Cyan
  • w : White

Once an escape sequence is printed, next text will be displayed using those foreground and background colors until meeting another escape sequence. It is better to reset it, after the text wanted to be highlighted, via $Cxx, so the terminal gets back to default properties.

Example:

xdbg("$(Cbg)blue on green$(Cxx) default colors $(Cbr)blue on red(Cxx)\n");
# print From URI in red
xdbg("From URI: $(Crx)$fu(Cxx)\n");


See aslo


Created by: miconda, Last modification: Fri 09 of Feb, 2007 (15:57 UTC)
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+