mobile-graphic-easel-src-easeljs-utils-Log.js / js
Log provides a centralized system for outputting errors. By default it will attempt to use console.log to output messages, but this can be changed by setting the out property. @class Log @constructor
Read-only. Output no messages. @type Number @property NONE @default 0 @static
Read-only. Error messages. @type Number @property ERROR @default 1 @static
Read-only. Warning messages. @type Number @property WARNING @default 2 @static
Read-only. Trace messages. @type Number @property TRACE @default 3 @static
Read-only. Output all messages. @type Number @property ALL @default 255 @static
Defines the function that will be used to handle any logged messages. By default it will use console.log. The specified function will be passed the same three parameters as Log.log, but the message will be expanded if a matching key was found.<br/><br/> For example, you could use this to log any messages to a server, or output it to a TextArea. You can disable all logging by setting this to null.<br/><br/> All messages are passed to the out function regardless of level settings, and the function must handle the level appropriately. This is to allow, for example, functions that log all messages to a server, but only display messages under the current level in the UI. @type Function @property out @static
Specifies the level of messages to output. For example, if you set <code>Log.level = Log.WARNING</code>, then any messages with a level of 2 (Log.WARNING) or less (ex. Log.ERROR) will be output. Defaults to Log.ALL. @type Function @property out @default 255 @static
@property _keys @static @type Array @protected
Adds a definition object that associates one or more keys with longer messages. These messages can optionally include "%DETAILS%" which will be replaced by any details passed with the error. For example:<br/> Log.addKeys( {MY_ERROR:"This is a description of my error [%DETAILS%]"} ); Log.error( "MY_ERROR" , 5 ); // outputs "This is a description of my error [5]"
parameter: {Object} keys The generic object defining the keys and messages. @static @method addKeys
Outputs the specified error via the method assigned to the "out" property. If the error matches a key in any of the loaded def objects, it will substitute that message.
parameter: {String} message The error message or key to output.
parameter: {Object} details Any details associated with this message.
parameter: {Number} level A number between 1 and 254 specifying the severity of this message. See Log.level for details. @static @method error
(C) Æliens 04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.