Debug Output

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
(Debugging levels)
(Debugging levels)
 
(19 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Debugging Output ==
+
Yate provides Debugging info on console.
  
=== Quick enabling debug - rmanager ===
+
The modalities to enable debug in Yate are:
 +
* from command line by adding -v options.
 +
* from telnet client ([[Rmanager]] module is required).
 +
 
 +
=== Quickly enable debug - rmanager ===
  
 
If you telnet into the rmanager interface you can enable debugging and increase the level using commands like the following:
 
If you telnet into the rmanager interface you can enable debugging and increase the level using commands like the following:
Line 17: Line 21:
 
Remember that after Yate starts you will need to enable debugging on each module individually.
 
Remember that after Yate starts you will need to enable debugging on each module individually.
  
=== Quick enabling debug - command line ===
+
=== Quickly enable 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:
 
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 =]
+
  yate -vvvvv -l logfile -d -s -r  
 
Each '''v''' character increases debugging by one, Five '''v''' as above gives the maximum debugging.
 
Each '''v''' character increases debugging by one, Five '''v''' as above gives the maximum debugging.
  
Line 28: Line 32:
 
* 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.
  
 
=== Debugging levels ===
 
=== Debugging levels ===
 
{|class="wikitable" border="1" style="text-align: center;"
 
{|class="wikitable" border="1" style="text-align: center;"
|-style="border-style: solid;"
+
!style="text-style: solid;"|Level
| Level | Shows | Code | Description
+
!style="text-style: solid;"|Shows
 +
!style="text-style: solid;"|Code  
 +
!style="text-style: solid;"|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.  
+
|style="text-align: left;"|DebugFail
 +
|FAIL  
 +
|0  
 +
|style="text-align: left;"|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.
+
|style="text-align: left;"|DebugTest  
| DebugGoOn | GOON | 2 | Serious programming errors that can be fixed automatically without crashing. Further functionality will probably be affected.
+
|TEST  
 +
|1  
 +
|style="text-align: left;"|Intended to be used only by programmers while debugging new code.
 
|-
 
|-
| DebugConf | CONF | 3 | Serious configuration error that prevents some component from starting.  
+
|style="text-align: left;"|DebugGoOn
 +
|GOON
 +
|2
 +
|style="text-align: left;"|Serious programming errors that can be fixed automatically without crashing. Further functionality will probably be affected.
 
|-
 
|-
| DebugStub | STUB | 4 | Programmer's stub - the functionality is not implemented yet.
+
|style="text-align: left;"|DebugConf
 +
|CONF
 +
|3
 +
|style="text-align: left;"|Serious configuration error that prevents some component from starting.  
 
|-
 
|-
| DebugWarn | WARN | 5 | Normal warning, something went wrong in a controlled way.
+
|style="text-align: left;"|DebugStub
 +
|STUB
 +
|4
 +
|style="text-align: left;"|Programmer's stub - the functionality is not implemented yet.
 
|-
 
|-
| DebugMild | MILD | 6 | Mild warning, something went wrong but was automatically corrected.
+
|style="text-align: left;"|DebugWarn
 +
|WARN
 +
|5
 +
|style="text-align: left;"|Normal warning, something went wrong in a controlled way.
 
|-
 
|-
| DebugCall | CALL | 7 | Call related information, nothing wrong.  
+
|style="text-align: left;"|DebugMild
 +
|MILD
 +
|6
 +
|style="text-align: left;"|Mild warning, something went wrong but was automatically corrected.
 
|-
 
|-
| DebugNote | NOTE | 8 | Less important note regarding normal operation.
+
|style="text-align: left;"|DebugNote  
 +
|NOTE  
 +
|7
 +
|style="text-align: left;"|Note related information, nothing wrong.  
 
|-
 
|-
| DebugInfo | INFO | 9 | Informative message including some protocol details.
+
|style="text-align: left;"|DebugCall
| DebugAll  | ALL  | 10 | Highest trace level detailing even code progress.
+
|CALL
 +
|8
 +
|style="text-align: left;"|Less important info regarding normal operation.
 +
|-
 +
|style="text-align: left;"|DebugInfo
 +
|INFO  
 +
|9  
 +
|style="text-align: left;"|Informative message including some protocol details.
 +
|-
 +
|style="text-align: left;"|DebugAll   
 +
|ALL   
 +
|10  
 +
|style="text-align: left;"|Highest trace level detailing even code progress.
 
|}
 
|}
  
Line 72: Line 113:
 
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.
 
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 [[Starting|command line]] or from the [[ConfigurationFiles|main configuration file]]. At runtime the debug levels can be changed by [[rmanager commands]] and they will persist until the server process is restarted.
+
Initial visibility levels can be set from the Yate [[Starting Yate|command line]] or from the [[Configuration Files|main configuration file]]. At runtime the debug levels can be changed by [[rmanager|rmanager commands]] and they will persist until the server process is restarted.
  
 
=== Limits ===
 
=== Limits ===
Line 84: Line 125:
 
Suppose Yate is started with '''-vv''' and in ''yate.conf'' we have:
 
Suppose Yate is started with '''-vv''' and in ''yate.conf'' we have:
 
   
 
   
{|
 
|
 
 
  [debug]
 
  [debug]
 
  sip=level 9
 
  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)
 
The engine, libraries and all modules will start at level 7 (DebugCall) except the SIP module which will start on level 9 (DebugInfo)
Line 101: Line 139:
 
  debug threshold 6
 
  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.
 
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.
 +
 +
 +
'''See also'''
 +
 +
* [[Starting Yate]]
 +
* [[Configuration Files]]
 +
* [[Rmanager]]
 +
* [[How To's]]
 +
 +
[[Category:Telnet]] [[Category:Rmanager]] [[Category:Debug]] [[Category:Debug level]]

Latest revision as of 16:08, 16 August 2023

Yate provides Debugging info on console.

The modalities to enable debug in Yate are:

  • from command line by adding -v options.
  • from telnet client (Rmanager module is required).

Contents

[edit] Quickly enable 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.

[edit] Quickly enable 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.

[edit] 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.

[edit] 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.
DebugNote NOTE 7 Note related information, nothing wrong.
DebugCall CALL 8 Less important info 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.

[edit] 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.

[edit] 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.

[edit] 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.


See also

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers