Packagecom.yworks.yfiles.util
Classpublic class LoggingUtil
InheritanceLoggingUtil Inheritance YObject Inheritance Object

Provides some convenience methods for code debugging and exception handling.

The behavior of this class can be adapted by starting the Java Virtual Machine with a set system property y.debug and y.debug.level. The default debug level is 2. It can be changed by setting the system property y.debug.level appropriately.



Public Methods
 MethodDefined By
  
LoggingUtil(init:Boolean = true)
LoggingUtil
 Inherited
equals(o:Object):Boolean
YObject
  
fatal(msg:Object):void
[static] Called on a fatal error.
LoggingUtil
  
fatal2(source:Object, msg:Object):void
[static] Outputs the class of the given object and the given message.
LoggingUtil
  
getClass():Class
[override]
LoggingUtil
 Inherited
hashCode():int
YObject
  
log(msg:Object):void
[static] Prints the given object to System.err unconditionally.
LoggingUtil
  
log2(level:int, msg:String):void
[static] Prints the given string to System.out if the given debug level if bigger than DEBUG_LEVEL.
LoggingUtil
  
log3(source:Object, msg:Object):void
[static] Print the given message to System.err if the fully qualified class name of the given source object is encoded in the system property y.debug and if the given debug level if bigger than DEBUG_LEVEL.
LoggingUtil
  
log4(source:Object, level:int, msg:Object):void
[static] Print the given message to System.err if the fully qualified class name of the given source object is encoded in the system property y.debug.
LoggingUtil
  
[static]
LoggingUtil
  
shortLog(msg:Object):void
[static] Like log(), but omits newline.
LoggingUtil
  
shortLog2(source:Object, msg:Object):void
[static] Like log3(), but does not append a newline to the output.
LoggingUtil
  
shortLog3(level:int, output:String):void
[static] Like log2(), but uses no line-feed.
LoggingUtil
  
show(ex:Error):void
[static] Displays the stack trace generated by the given exception in a dialog window.
LoggingUtil
  
showError(obj:Object):void
[static] Displays the string representation of the given object in a dialog window.
LoggingUtil
  
watch(source:String):Boolean
[static] Returns true if the given object type is under observation due to the -Dy.debug mechanism.
LoggingUtil
  
watchSource(source:Object):Boolean
[static] Returns true if the given object type is under observation due to the -Dy.debug mechanism.
LoggingUtil
Protected Methods
 MethodDefined By
  
LoggingUtil
Public Constants
 ConstantDefined By
  DEBUG_LEVEL : int = 2
[static] The debug level threshold.
LoggingUtil
Constructor Detail
LoggingUtil()Constructor
public function LoggingUtil(init:Boolean = true)



Parameters
init:Boolean (default = true)
Method Detail
fatal()method
public static function fatal(msg:Object):void

Called on a fatal error. Mostly used in a catch statement to signal a definite bug.

Parameters

msg:Object

fatal2()method 
public static function fatal2(source:Object, msg:Object):void

Outputs the class of the given object and the given message. Then throws a RuntimeException using the same message.

Mostly used in a catch statement to signal a definite bug.

Parameters

source:Object
 
msg:Object

getClass()method 
override public function getClass():Class

Returns
Class
initLoggingUtil()method 
protected final function initLoggingUtil():void

log()method 
public static function log(msg:Object):void

Prints the given object to System.err unconditionally.

Parameters

msg:Object

log2()method 
public static function log2(level:int, msg:String):void

Prints the given string to System.out if the given debug level if bigger than DEBUG_LEVEL.

Parameters

level:int
 
msg:String

log3()method 
public static function log3(source:Object, msg:Object):void

Print the given message to System.err if the fully qualified class name of the given source object is encoded in the system property y.debug and if the given debug level if bigger than DEBUG_LEVEL.

The value of the y.debug property is a colon separated list of fully qualified class name prefixes. If the name of the given class starts with one of the specified prefixes the debug message will be printed to System.err.

Parameters

source:Object
 
msg:Object

log4()method 
public static function log4(source:Object, level:int, msg:Object):void

Print the given message to System.err if the fully qualified class name of the given source object is encoded in the system property y.debug.

The value of the y.debug property is a colon separated list of fully qualified class name prefixes. If the name of the given class starts with one of the specified prefixes the debug message will be printed to System.err.

Parameters

source:Object
 
level:int
 
msg:Object

newLoggingUtil()method 
public static function newLoggingUtil():LoggingUtil

Returns
LoggingUtil
shortLog()method 
public static function shortLog(msg:Object):void

Like log(), but omits newline.

Parameters

msg:Object

See also

shortLog2()method 
public static function shortLog2(source:Object, msg:Object):void

Like log3(), but does not append a newline to the output.

Parameters

source:Object
 
msg:Object

See also

shortLog3()method 
public static function shortLog3(level:int, output:String):void

Like log2(), but uses no line-feed.

Parameters

level:int
 
output:String

See also

show()method 
public static function show(ex:Error):void

Displays the stack trace generated by the given exception in a dialog window.

Parameters

ex:Error

showError()method 
public static function showError(obj:Object):void

Displays the string representation of the given object in a dialog window.

Parameters

obj:Object

watch()method 
public static function watch(source:String):Boolean

Returns true if the given object type is under observation due to the -Dy.debug mechanism.

Parameters

source:String

Returns
Boolean
watchSource()method 
public static function watchSource(source:Object):Boolean

Returns true if the given object type is under observation due to the -Dy.debug mechanism.

Parameters

source:Object

Returns
Boolean
Constant Detail
DEBUG_LEVELConstant
public static const DEBUG_LEVEL:int = 2

The debug level threshold. Its default value is 2 but may be changed by setting the system property y.debug.level.