SkylinkJS has a fairly complex logging system in place that will allow you to explore the details of your connection in depth and debug a variety of issues. Below are some details on its use. 


By default, given that you are you are using the non-minified versions of the libary,  the console displays logs of type console.warn, console.info and console.error. If you wish to enable more detailed debug logs or hide the default log output this can be configured with the Skylink.setLogLevel method.


http://cdn.temasys.com.sg/skylink/skylinkjs/latest/doc/classes/Skylink.html#method_setLogLevel


Usage Example:


 

SkylinkDemo.setLogLevel(4);
SkylinkDemo.setLogLevel(SkylinkDemo.LOG_LEVEL.LOG);

 



It is recommended that the log level is set immediately following the declaration of the Skylink class object.


Usage Example:


 

var SkylinkDemo = new Skylink();
SkylinkDemo.setLogLevel(SkylinkDemo.LOG_LEVEL.LOG);

 


The list of available levels are based off from the Skylink.LOG_LEVEL attribute: 


http://cdn.temasys.com.sg/skylink/skylinkjs/latest/doc/classes/Skylink.html#attr_LOG_LEVEL

  • DEBUG (4): Shows all debugging level logs (which includes the code execution steps)
  • LOG (3): Shows debugging level logs but omits the code execution logs.
  • INFO (2): Shows informational logs like for instance the data received from the api server.
  • WARN (3): Shows warning logs that warns users over implementation issues.
  • ERROR (4): Shows the errors that are thrown during execution.


You may also want to explore setDebugMode which allows you to enable each log to reference to the original line of code which triggered the log message or enabling the log capture functionality to store all the logs in an array [SkylinkLogs].


http://cdn.temasys.com.sg/skylink/skylinkjs/latest/doc/classes/Skylink.html#method_setDebugMode


Usage Example:


 

var SkylinkDemo = new Skylink();
SkylinkDemo.setDebugMode({
  trace: [true/false],
  storeLogs: [true/false]
});

 


By default, the trace mode and log storage is disabled. If you have set storeLogs option to true, you are able view stored logs via the global variable [SkylinkLogs].

 

http://cdn.temasys.com.sg/skylink/skylinkjs/latest/doc/classes/Skylink.html#property_SkylinkLogs


There are 3 methods where you can manipulate the SkylinkLogs array.


Option 1: To print out all the logs

http://cdn.temasys.com.sg/skylink/skylinkjs/latest/doc/classes/Skylink.html#property_SkylinkLogs.printAllLogs


Option 2: Return an array of the logs.

http://cdn.temasys.com.sg/skylink/skylinkjs/latest/doc/classes/Skylink.html#property_SkylinkLogs.getLogs


Option 3: To clear all the stored logs.

http://cdn.temasys.com.sg/skylink/skylinkjs/latest/doc/classes/Skylink.html#property_SkylinkLogs.clearAllLogs