Set log level.
Coverage of logging data in each log level: DEBUG < INFO < WARN < ERROR.
Following is the expected behavior to cover log messages at specific log levels:
ERROR : only ERROR messages
WARN : ERROR and WARN messages
INFO : ERROR, WARN and INFO
DEBUG : ERROR, WARN, INFO and DEBUG
For example, if you want to get all log messages, you need to set the log to the 'Debug' level. If the WARN level is set, logging data contains WARN and ERROR messages.
Default log level is ERROR.
<static> setLogLevel( level, [successCallback], [errorCallback] )
Name | Type | Argument | Description |
level | String | Log level to set [DEBUG, INFO, WARN, ERROR] | |
successCallback | function | (optional) | Callback function called when the log level has been successfully set.No object will be passed to success callback. |
errorCallback | function | (optional) | Callback function called when an error occurs while setting the log level.Since Kapsel Logger native code will always call the success callback function, the errorCallback function will be executed by Cordova if an error or exception occurs while making the call to the plugin. |
sap.Logger.setLogLevel(sap.Logger.DEBUG, successCallback, errorCallback); function successCallback() { alert("Log level set"); } function errorCallback() { alert("Failed to set log level"); }