Debug Output

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
(Quick enabling debug - command line)
(Output)
Line 28: Line 28:
 
* In the local console output if Yate was started interactively
 
* In the local console output if Yate was started interactively
 
* To a log file if it was specified on the command line (disables console output)
 
* To a log file if it was specified on the command line (disables console output)
* On a remote console that can be accessed with a [[http://en.wikipedia.org/wiki/Telnet|telnet]] client program (needs the [[rmanager]] module)
+
* On a remote console that can be accessed with a [http://en.wikipedia.org/wiki/Telnet telnet] client program (needs the [[rmanager]] module)
 
Optionally the output can be colorized for either type of console but not for logs.
 
Optionally the output can be colorized for either type of console but not for logs.
  

Revision as of 10:35, 22 October 2012

Contents

Debugging Output

Quick enabling debug - rmanager

If you telnet into the rmanager interface you can enable debugging and increase the level using commands like the following:

$ telnet localhost 5038
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
Yate 4.1.1 (http://YATE.null.ro) ready on localhost.
debug on
debug level 10
debug sip level 10
color on

Remember that after Yate starts you will need to enable debugging on each module individually.

Quick enabling debug - command line

The easiest way is to globally increase the visible debug level by adding -v options to the Yate command line or the service start script:

yate -vvvvv -l logfile -d -s -r 

Each v character increases debugging by one, Five v as above gives the maximum debugging.

Output

Debug information can be displayed in several places:

  • In the local console output if Yate was started interactively
  • To a log file if it was specified on the command line (disables console output)
  • On a remote console that can be accessed with a telnet client program (needs the rmanager module)

Optionally the output can be colorized for either type of console but not for logs.

Debugging levels

Level Shows Code Description
DebugFail FAIL 0 The most severe error level, reserved for unmanageable errors. The -Da command line option allows Yate to abort immediately after displaying such an error although it would probably crash anyway.
DebugTest TEST 1 Intended to be used only by programmers while debugging new code.
DebugGoOn GOON 2 Serious programming errors that can be fixed automatically without crashing. Further functionality will probably be affected.
DebugConf CONF 3 Serious configuration error that prevents some component from starting.
DebugStub STUB 4 Programmer's stub - the functionality is not implemented yet.
DebugWarn WARN 5 Normal warning, something went wrong in a controlled way.
DebugMild MILD 6 Mild warning, something went wrong but was automatically corrected.
DebugCall CALL 7 Call related information, nothing wrong.
DebugNote NOTE 8 Less important note regarding normal operation.
DebugInfo INFO 9 Informative message including some protocol details.
DebugAll ALL 10 Highest trace level detailing even code progress.

Note that the most important debugging messages have numerically lower levels.

Visibility

To avoid cluttering the logs and terminal output with unimportant messages it is possible to only display messages with a level numerically lower (that is, more important) than a specific limit:

  • debugging can be turned on / off for the engine
  • debugging can be turned on / off for individual modules or components
  • a limit can be set for the engine
  • a limit can be set for individual modules or components
  • a threshold can be specified for a rmanager connection.

If a limit is set per engine or module or component messages less important (having a numerically higher level) will not be displayed in either output and will not slow down processing.

If a threshold is set for a rmanager connection if will filter out only debugging on that specific connection. Other active messages will still be displayed on console or logged to file.

Initial visibility levels can be set from the Yate command line or from the main configuration file. At runtime the debug levels can be changed by rmanager commands and they will persist until the server process is restarted.

Limits

To make sure you see the important messages the lowest display level is limited to DebugConf for engine, modules or rmanager thresholds.

IMPORTANT: Even if the minimim debug level is limited the debugging can still be turned off entirely.

Example

Suppose Yate is started with -vv and in yate.conf we have:

[debug]
sip=level 9

The engine, libraries and all modules will start at level 7 (DebugCall) except the SIP module which will start on level 9 (DebugInfo)

$ telnet localhost 5038
debug on
color on
debug sip level 10
debug yrtp level 10

This will enable colorful debugging on the connection you are on and then increase debugging level to 10 (maximum) for the SIP and RTP modules.

debug threshold 6

Now the local connection will show only messages of level 6 (DebugMild) or more important although all enabled levels will still be written to logs and other telnet connections.

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers