logging: Logging

The forge.logging namespace allows you to log a message, and optionally an exception, to the console service provided by the underlying platform.

Config options

Level
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.

API

forge.logging.log(message[, exception][, level])

iOS, Android, Web

Log a message or exception

Parameters:
message
string a string to log on the console
exception
Error an optional JavaScript Error instance: details from the exception will be appended to your log message
level
logging.level importance of this message: one of forge.logging.DEBUG, forge.logging.INFO, forge.logging.WARNING, forge.logging.ERROR or forge.logging.CRITICAL

forge.logging.debug(message[, exception])

iOS, Android, Web

Shorthand for forge.logging.log(message[, exception], forge.logging.DEBUG).

Parameters:
message
string a string to log on the console
exception
Error an optional JavaScript Error instance: details from the exception will be appended to your log message

forge.logging.info(message[, exception])

iOS, Android, Web

Shorthand for forge.logging.log(message[, exception], forge.logging.INFO).

Parameters:
message
string a string to log on the console
exception
Error an optional JavaScript Error instance: details from the exception will be appended to your log message

forge.logging.warning(message[, exception])

iOS, Android, Web

Shorthand for forge.logging.log(message[, exception], forge.logging.WARNING).

Parameters:
message
string a string to log on the console
exception
Error an optional JavaScript Error instance: details from the exception will be appended to your log message

forge.logging.error(message[, exception])

iOS, Android, Web

Shorthand for forge.logging.log(message[, exception], forge.logging.ERROR).

Parameters:
message
string a string to log on the console
exception
Error an optional JavaScript Error instance: details from the exception will be appended to your log message

forge.logging.critical(message[, exception])

iOS, Android, Web

Shorthand for forge.logging.log(message[, exception], forge.logging.CRITICAL).

Parameters:
message
string a string to log on the console
exception
Error an optional JavaScript Error instance: details from the exception will be appended to your log message