API Documentation for: 0.6.1
Show:

Log Class

Defined in: Log:34
Module: EaselJS

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.

Constructor

Log

()

Defined in Log:34

Item Index

Methods

Properties

Methods

addKeys

(
  • keys
)
static

Defined in addKeys:125

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:
Log.addKeys( {MYERROR:"This is a description of my error [%DETAILS%]"} ); Log.error( "MYERROR" , 5 ); // outputs "This is a description of my error [5]"

Parameters:

  • keys Object

    The generic object defining the keys and messages.

error

(
  • message
  • details
  • level
)
static

Defined in error:139

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.

Parameters:

  • message String

    The error message or key to output.

  • details Object

    Any details associated with this message.

  • level Number

    A number between 1 and 254 specifying the severity of this message. See Log.level for details.

Properties

_keys

Array protected static

Defined in _keys:117

ALL

Number static

Defined in ALL:78

Read-only. Output all messages.

Default: 255

ERROR

Number static

Defined in ERROR:51

Read-only. Error messages.

Default: 1

NONE

Number static

Defined in NONE:42

Read-only. Output no messages.

Default: 0

out

Function static

Defined in out:87

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.

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.

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.

out

Function static

Defined in out:107

Specifies the level of messages to output. For example, if you set Log.level = Log.WARNING, then any messages with a level of 2 (Log.WARNING) or less (ex. Log.ERROR) will be output. Defaults to Log.ALL.

Default: 255

TRACE

Number static

Defined in TRACE:69

Read-only. Trace messages.

Default: 3

WARNING

Number static

Defined in WARNING:60

Read-only. Warning messages.

Default: 2