log( sMsg, eLevel, notifyUser ) method

Allows the user to log a message to the device trace log which can be remotely retrieved from the server.

Whether the message actually gets logged will depend on how the log level that the administrator has selected for this device user compares with the log level of this message. The logging level and alert dialog callback can be set with hwc.setLoggingCurrentLevel and setLoggingAlertDialog.

Syntax

<static> log( sMsg, eLevel, notifyUser )

Parameters

Name Type Description
sMsg string The message to be logged.
eLevel string The error level for this message.This parameter must be one of: "ERROR", "WARN", "INFO" or "DEBUG".
notifyUser boolean Whether the logging alert callback will be invoked.This parameter is independent of the logging level (the logging alert callback will always be invoked if this is true, and never if this is false).

Example

var logAlert = function( message )
{
   alert( "New log message: " + message );
}
hwc.setLoggingAlertDialog( logAlert );
hwc.setLoggingCurrentLevel( 3 );
// The following will be logged, and the logging alert dialog will be invoked.
hwc.log( "info message notify", "INFO", true );
// The following will be logged, but the logging alert dialog will not be invoked.
hwc.log( "info message", "INFO", false );
// The following will not be logged, but the logging alert dialog will be invoked.
hwc.log( "debug message notify", "DEBUG", true );
// The following will not be logged, and the logging alert dialog will not be invoked.
hwc.log( "debug message", "DEBUG", false );

Source

hwc-comms.js, line 902.