Console
| Kind of class: | class |
|---|---|
| Inherits from: | none |
| Author: | Jeremy Brown, Arthur Clemens |
| Classpath: | org.asapframework.util.debug.Console |
| File last modified: | Thursday, 12 October 2006, 11:19:40 |
Console creates a debugging window on the stage that can be invoked with a configurable string. Close the window by double-clicking the bar.
Usage:
- The console is enabled by default. If you don't want to use the console, add this class to the exclude xml.
You can set a character or word to activate the console. To set the activation string, use:Console.sActivationString = "trace";The default activation string is "debug".
Hide the console by clicking on the top right button.
There are 5 log levels: DEBUG, INFO, WARN, ERROR and FATAL. Default is DEBUG_LEVEL. To set the log level (and to ignore messages of lower rank), use:Console.logLevel = Console.DEBUG_LEVEL;
Example usage:Console.INFO("Version: Mon 10 May 2004"); Console.INFO("Environment: ", Environment.getEnvironment());
Version history:
- 2 May 2005: Fixed bugs to enable for Flash 7; added a close button; when activationString is "", press space bar to make visible again.
- 16 Jan 2005: Made the console enabled by default.
- 28 Sep 2004: Optimized KeyListener.
- 17 Sep 2004: Added strings "DEBUG", "INFO" etc to messages. Added double-click to hide window.
To do:
- NICE:
Add a scrollbar
Add a clear button
Add error level buttons in the bar
Make the top bar visually more bar like, with a grip
Summary
Class properties
- DEBUG_LEVEL : Object
- INFO_LEVEL : Object
- WARN_LEVEL : Object
- ERROR_LEVEL : Object
- FATAL_LEVEL : Object
- DOUBLE_CLICK_DELAY : Number
- sLogLevel : Number
- FONT_TYPE : String
- FONT_SIZE : Number
- MAXDEPTH : Number
- CONSOLE_COLOR : Number
- sHolderClip : MovieClip
- sIsEnabled : Boolean
- sOwner : Object
- sOpenState : String
- sWidth : Number
- sHeight : Number
- sHandleHeight : Number
- sAlpha : Number
- sDepth : Number
- sBgColor : Number
- sActivationString : String
- sScrolls : Boolean
- logLevel (inLogLevel:Number) : Number
- enabled (inIsEnabled:Boolean) : Boolean
- scroll (inScroll:Boolean)
- state : String
- activationString (inString:String) : String
- The text string to make the Console appear on screen.
- alpha (inAlpha:Number) : Number
- Alpha of the background.
Class methods
- DEBUG (objValue:Object) : Void
- INFO (objValue:Object) : Void
- WARN (objValue:Object) : Void
- ERROR (objValue:Object) : Void
- FATAL (objValue:Object) : Void
- assertWriteMessage (inLevel:Object, objValue:Object) : Void
- createConsole : Void
- closeConsole : Void
- minimizeConsole : Void
- openConsole : Void
- placeConsole : Void
- createPrintMessage : String
- doWriteMessage (inLevel:Object) : Void
- writeToConsole (inMessage:String, inLevel:Object) : Void
Class properties
activationString
static activationString:String
(write)
The text string to make the Console appear on screen.
alpha
static alpha:Number
(write)
Alpha of the background.
CONSOLE_COLOR
static private CONSOLE_COLOR:Number = 0x888888
(read)
DEBUG_LEVEL
static DEBUG_LEVEL:Object = /**< Typecode for debugging messages. */
(read)
DOUBLE_CLICK_DELAY
static DOUBLE_CLICK_DELAY:Number = 250
(read)
enabled
static enabled:Boolean
(write)
ERROR_LEVEL
static ERROR_LEVEL:Object = /**< Typecode for error messages. */
(read)
FATAL_LEVEL
static FATAL_LEVEL:Object = /**< Typecode for fatal error messages. */
(read)
FONT_SIZE
static private FONT_SIZE:Number = 10
(read)
FONT_TYPE
static private FONT_TYPE:String = "Verdana"
(read)
INFO_LEVEL
static INFO_LEVEL:Object = /**< Typecode for informational messages. */
(read)
logLevel
static logLevel:Number
(write)
MAXDEPTH
static private MAXDEPTH:Number = 1048575
(read)
sActivationString
static private sActivationString:String = "debug"
(read)
sAlpha
static private sAlpha:Number = 65
(read)
sBgColor
static private sBgColor:Number = 0xFFFFFF
(read)
scroll
static scroll
(write)
sDepth
static private sDepth:Number = MAXDEPTH
(read)
sHandleHeight
static private sHandleHeight:Number = 16
(read)
sHeight
static private sHeight:Number = 300
(read)
sHolderClip
static private sHolderClip:MovieClip
(read)
sIsEnabled
static private sIsEnabled:Boolean = true
(read)
sLogLevel
static private sLogLevel:Number = DEBUG_LEVEL.level
(read)
sOpenState
static private sOpenState:String = "open"
(read)
sOwner
static private sOwner:Object = _root
(read)
sScrolls
static private sScrolls:Boolean = true
(read)
state
static state:String
(read)
sWidth
static private sWidth:Number = 400
(read)
WARN_LEVEL
static WARN_LEVEL:Object = /**< Typecode for warning messages. */
(read)
Class methods
assertWriteMessage
static private function assertWriteMessage (
inLevel:Object,
objValue:Object) : Void
closeConsole
static function closeConsole (
) : Void
createConsole
static private function createConsole (
) : Void
createPrintMessage
static private function createPrintMessage (
) : String
DEBUG
static function DEBUG (
objValue:Object) : Void
doWriteMessage
static private function doWriteMessage (
inLevel:Object) : Void
ERROR
static function ERROR (
objValue:Object) : Void
FATAL
static function FATAL (
objValue:Object) : Void
INFO
static function INFO (
objValue:Object) : Void
minimizeConsole
static function minimizeConsole (
) : Void
openConsole
static function openConsole (
) : Void
placeConsole
static function placeConsole (
) : Void
WARN
static function WARN (
objValue:Object) : Void
writeToConsole
static private function writeToConsole (
inMessage:String,
inLevel:Object) : Void