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

Usage Example:




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

Usage Example:


var SkylinkDemo = new Skylink();


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

  • 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].

Usage Example:


var SkylinkDemo = new Skylink();
  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].

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

Option 1: To print out all the logs

Option 2: Return an array of the logs.

Option 3: To clear all the stored logs.