From WikiChip
Difference between revisions of "mirc/commands/debug"
< mirc‎ | commands

m (Bot: Adding a template)
(Add'l syntax)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The '''/debug command''' outputs raw server messages to a file or a custom window  Incoming messages are prefixed with '''<-''' and outgoing messages are prefixed with '''->'''
+
{{mirc title|/debug Command}}
 +
The '''/debug''' command outputs raw server messages to a file or a custom window  Incoming messages are prefixed with '''<-''' and outgoing messages are prefixed with '''->'''
  
 
== Synopsis ==
 
== Synopsis ==
  /debug [-cinpt] [color] [on | off | @window | filename] [identifier]
+
  /debug [-cinptrNoN] [color_index] [on | off | @window | filename] [identifier]
  
 
== Switches ==
 
== Switches ==
 
* '''-c''' - Turns off debugging (close associated window as well)
 
* '''-c''' - Turns off debugging (close associated window as well)
* '''-i''' - Call a specific identifier before debug is logged
+
* '''-i''' - Call a specific $identifier and use the returned value as the debug lines
* '''-n''' - Minimize the custom window
+
* '''-n''' - Minimize the custom @window
* '''-p''' - Wrap text
+
* '''-p''' - Wrap the debug lines if it is too long for the @window
* '''-t''' - Timestamp
+
* '''-t''' - Adds timestamp to the debug lines
 +
* '''-rN''' - Uses the N color index as the line color for received debug lines.
 +
* '''-oN''' - Uses the N color index as the line color for outbound debug lines.
  
 
== Parameters ==
 
== Parameters ==
* '''[color]''' - Optional text color for the debug window
+
* '''[color]''' - Optional text color for the debug window (Partly overridden by -rN and/or -oN) Can be color index 0-99
 
* '''[on|off]''' - Turns debug on or off
 
* '''[on|off]''' - Turns debug on or off
 
* '''[@window|filename]''' - outputs to a custom @window or a file
 
* '''[@window|filename]''' - outputs to a custom @window or a file
Line 18: Line 21:
  
 
== Example ==
 
== Example ==
<syntaxhighlight lang="mIRC">;Opens @raw debug window (wrap text+
+
<source lang="mIRC">;Opens @raw debug window (wrap text+
//debug -p @Raw</syntaxhighlight>
+
//debug -p @Raw</source>
  
<syntaxhighlight lang="mIRC">;The line can be 'piped' through an alias on its way to the log file.
+
<source lang="mIRC">;The line can be 'piped' through an alias on its way to the log file.
 
+
From editbox: /debug -i Log.txt $console
/debug -i Log.txt $console
+
From script:  /debug -i Log.txt $!console
  
 
Alias console {
 
Alias console {
Line 37: Line 40:
 
   ; return the line back to mIRC's log
 
   ; return the line back to mIRC's log
 
   return $1-
 
   return $1-
}</syntaxhighlight>
+
}</source>
  
== Compatibility ==
+
<source lang="mIRC">
Added: mIRC v6.0
+
: This alias opens a debug window shared by all networks. Outbound lines in red, inbound lines in green. Note the identifier is listed on command line instead of calling an alias. The yellow 8 is overridden by defining in/out colors with -rNoN. Alias uses $time to display seconds without forcing all windows to show seconds in their $timestamp too
 +
on *:CONNECT:{ debugg }
  
Added On: 03/02/2002
+
alias debugg {
 
+
  window -ze2Dj2000k @debug
<small>Note: Individual switches were not taken into consideration.</small>
+
  titlebar @debug active= $+ $scid($window(@debug).cid).network logging: $addtok($gettok($window(@debug).titlebar,3-,32),$network,32)
 +
  debug -pir44o52 8 @debug $!+([,$time,],[,$network,] $!1-)
 +
} ; Raccoon's altered by maroon
 +
</source>
  
 +
== Compatibility ==
 +
{{mIRC compatibility|6.0}}
 
== See also ==
 
== See also ==
* [[List of commands - mIRC|List of commands]]
+
* {{mIRC|$debug}}
* [[List of identifiers - mIRC|List of identifiers]]
+
* {{mIRC|$rawmsg}}
* [[$debug identifier - mIRC|$debug]]
 
* [[$rawmsg identifier - mIRC|$rawmsg]]
 
{{mIRC command list}}
 
 
 
[[Category:MIRC commands]]
 

Latest revision as of 20:39, 20 May 2018

The /debug command outputs raw server messages to a file or a custom window Incoming messages are prefixed with <- and outgoing messages are prefixed with ->

Synopsis[edit]

/debug [-cinptrNoN] [color_index] [on | off | @window | filename] [identifier]

Switches[edit]

  • -c - Turns off debugging (close associated window as well)
  • -i - Call a specific $identifier and use the returned value as the debug lines
  • -n - Minimize the custom @window
  • -p - Wrap the debug lines if it is too long for the @window
  • -t - Adds timestamp to the debug lines
  • -rN - Uses the N color index as the line color for received debug lines.
  • -oN - Uses the N color index as the line color for outbound debug lines.

Parameters[edit]

  • [color] - Optional text color for the debug window (Partly overridden by -rN and/or -oN) Can be color index 0-99
  • [on|off] - Turns debug on or off
  • [@window|filename] - outputs to a custom @window or a file
  • [identifier] - Calls an identifier before logging the debugged line (the returned value if used for the logging)

Example[edit]

;Opens @raw debug window (wrap text+
//debug -p @Raw
;The line can be 'piped' through an alias on its way to the log file.
From editbox: /debug -i Log.txt $console
From script:  /debug -i Log.txt $!console
 
Alias console {
  ; split by spaces
  tokenize 32 $1-
 
  ; open window if not already opened
  if (!$window(Console)) window -e @Console
 
  if (<- == $1) aline -p 9 @Console >> $2-
  else aline -p 4 @Console << $2-
 
  ; return the line back to mIRC's log
  return $1-
}
: This alias opens a debug window shared by all networks. Outbound lines in red, inbound lines in green. Note the identifier is listed on command line instead of calling an alias. The yellow 8 is overridden by defining in/out colors with -rNoN. Alias uses $time to display seconds without forcing all windows to show seconds in their $timestamp too
on *:CONNECT:{ debugg }
 
alias debugg {
  window -ze2Dj2000k @debug
  titlebar @debug active= $+ $scid($window(@debug).cid).network logging: $addtok($gettok($window(@debug).titlebar,3-,32),$network,32)
  debug -pir44o52 8 @debug $!+([,$time,],[,$network,] $!1-)
 } ; Raccoon's altered by maroon

Compatibility[edit]

Added: mIRC v6.0
Added on: 03 Feb 2002
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.

See also[edit]