logging: Logging¶
Allows you to log a message, and optionally an exception, to the console service provided by the underlying platform.
Config¶
The logging.level configuration directive controls the verbosity of the logging system. It should be set to one of DEBUG, INFO, WARNING, ERROR or CRITICAL. A setting of DEBUG means that all messages will be logged, whereas a setting of CRITICAL means that only messages of level CRITICAL will be logged.
{
"modules": {
"logging": {
"level": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
},
}
}
Platforms: Internet Explorer only
The logging.console configuration directive enables a log window for the add-on's background page.
"logging": {
"console": true
},
API¶
log¶
Platforms: All
- logging.log(message[, exception][, level])¶
Arguments: - message -- a string to log on the browser console
- exception -- a JavaScript Error instance: details from the exception will be appended to your log message
- level -- importance of this message: one of forge.logging.DEBUG, forge.logging.INFO, forge.logging.WARNING, forge.logging.ERROR or forge.logging.CRITICAL
- logging.debug(message[, exception])¶
Shorthand for forge.logging.log(message[, exception], forge.logging.DEBUG)
- logging.info(message[, exception])¶
Shorthand for forge.logging.log(message[, exception], forge.logging.INFO)
- logging.warning(message[, exception])¶
Shorthand for forge.logging.log(message[, exception], forge.logging.WARNING)
- logging.error(message[, exception])¶
Shorthand for forge.logging.log(message[, exception], forge.logging.ERROR)
- logging.critical(message[, exception])¶
Shorthand for forge.logging.log(message[, exception], forge.logging.CRITICAL)