Adobe DPS - Reading SDK 2.32

Class adobeDPS-Log

Platforms:
iOS, Android, Windows

Class used for logging within the Adobe Library API. The Adobe Library API logs many of its actions, so users of the API can debug issues with their usage of the API by calling Log.print()

// Usage Example
Log.instance.info("Received response from server");
Log.instance.warn("Bad response from server");
// Will return a string containing all logs of type WARN, INFO without timestamps
var logString = Log.instance.print(Log.instance.logLevels.WARN,Log.instance.logLevels.INFO,false);
console.log(logString);

Constructor

adobeDPS-Log()
[inner] Creates an instance of the Log class.

Static Fields

Field Defined By
adobeDPS-Log.instance
The singleton of the Log.
Log

Fields

Field Defined By
enableLogging : Boolean
Enable logging service.
Log
The log levels that may be used.
Log

Methods

Method Defined By
error(error:Error)
Log an error.
Log
warn(msg:String)
Log an message at warning level.
Log
info(msg:String)
Log an message at info level.
Log
debug(msg:String)
Log an message at debug level.
Log
profile(id:String)
Function used to create and execute profilers.
Log
bridge(msg)
Function used to send bridge specific log information.
Log
print(lvls:Number, timestamp:Boolean)
Function used to get log information for some subset of the available LogLevels.
Log
clear()
Function used to clear the log
Log
Class Detail
adobeDPS-Log()
[inner] Creates an instance of the Log class.
- This is an internal constructor and shouldn't be called by regular users.
Static Field Details
adobeDPS-Log.instance
The singleton of the Log.
Platforms:
iOS, Android, Windows
Field Details
enableLogging : Boolean
Enable logging service. Defaults to true. If it is false all calls to the Logging service will be disabled
Platforms:
iOS, Android, Windows
logLevels
The log levels that may be used. They are used as bit-masks with the print() function to determine which logs to produce.
Platforms:
iOS, Android, Windows
Method Details
error(error:Error)
Log an error. This will also try to print a stackTrace if printStackTrace is available.
Parameters
error Error The error that you wish to log
Platforms:
iOS, Android, Windows
warn(msg:String)
Log an message at warning level.
Parameters
msg String The message that you wish to log
Platforms:
iOS, Android, Windows
info(msg:String)
Log an message at info level.
Parameters
msg String The message that you wish to log
Platforms:
iOS, Android, Windows
debug(msg:String)
Log an message at debug level.
Parameters
msg String The message that you wish to log
Platforms:
iOS, Android, Windows
profile(id:String)
Function used to create and execute profilers. Each profiler is given an id. When this is called again with the same id, the profiler will be executed and the time between calls will be logged along with the id of the profiler. For this reason, id's should be used that are descriptive of what is being profiled.
Parameters
id String The id of the profiler to be created or executed
Platforms:
iOS, Android, Windows
bridge(msg)
Function used to send bridge specific log information. This should only be used within the API to log all communications across the bridge. This should not be used outside of the API because it will pollute the bridge specific logs.
Parameters
msg The message that you wish to log
Platforms:
iOS, Android, Windows
print(lvls:Number, timestamp:Boolean)
Function used to get log information for some subset of the available LogLevels. Multiple levels can be requested by creating a bitmask of the LogLevels to be returned. I.E. LogLevels.ERROR | LogLevels.WARN.
// Will return a string containing all logs of type ERROR, WARN, INFO, DEBUG
Log.instance.print(Log.instance.logLevels.ERROR | Log.instance.logLevels.WARN | Log.instance.logLevels.INFO | Log.instance.logLevels.DEBUG)
Parameters
lvls Number The bitmask of the levels that should be returned
timestamp Boolean Whether the log messages should be timestamped
Platforms:
iOS, Android, Windows
clear()
Function used to clear the log
Platforms:
iOS, Android, Windows
©2012-2013 Adobe Systems, inc
Documentation generated by JsDoc Toolkit 2.4.0 on Mon Aug 31 2015 09:23:40 GMT-0700 (PDT)