Cannon.Logger
Cannon.Logger is a log system, similar to what console.log offers. It is sued internally by the framework to provide informations about everything that is happening, but it can also be easily used by anyone.
Array that contains ll the logs, stored as objects. Each log object contains the following properties :
- message
- level
- date
- caller
Constant for the log level Info.
Constant for the log level Warning.
Constant for the log level Error.
Maximum number of logs to be displayed when autologing is turned on. Default is 10.
Turns autologing on or off.
The element to witch the logs are appended when autologing is on.
- message:String
- level:String : optionnal, default to Cannon.Logger.Info.
Adds a message to the log. The optional level parameter can be Cannon.Logger.Info, Cannon.Logger.Warning or Cannon.Logger.Error.
- log:Object
Turns a log object into a string.
- log:Object
Turns a log object into a bit of HTML.
Turns the whole logs into HTML.
- element:DOMElement
Calling this function will active the autologing process. The element passed as parameter will see it's content updated with the logs already in the logstack, and any further logs will be appended to it.
In order not to slow the page down with too much content in the DOM, only the last few logs will be displayed. How many exactly is controlled by the maxlog property.
TO turn autologing off after it has been started, set the autologing property to false.