Skip to content

Example showing how to log data from iViewer to the Rollbar cloud service.

Notifications You must be signed in to change notification settings

CommandFusion/RollbarLogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logging to Rollbar with CommandFusion iViewer

This sample project shows how you can log any data from your iViewer projects to a remote logging service called Rollbar.
Rollbar offer various pricing tiers for their service, starting with FREE logging for up to 5,000 log calls a month.

Getting Started

  1. Signup for an account at Rollbar.com
  2. Create a project in your Rollbar account. You could create separate projects for each iViewer project you want to monitor, or just have them all logging to a single project.
  3. Change the token in main.js to use the access token Rollbar assigned to your project.
  4. Open the logging_example.gui in guiDesigner
  5. Add your iViewer license code to the project.
    Logging won't work without a license as it uses our CF.request JS API that is only available for licensed devices!
  6. Load the guiDesigner project into iViewer on your device and watch logs appear in your Rollbar account.

Init Options

When initialising the Rollbar script, you can have it automatically watch all system connections, and app suspend/resume events.

See main.js for how this is done:

CFRollbar.init({
	accessToken: "YOUR CLIENT ACCESS TOKEN HERE",
	watchSystems: true,
	watchSuspend: true,
	watchResume: true
});

Usage

Once initialized, you can call Rollbar from anywhere in your code, commands, buttons, etc. Some examples:

// Standard log calls
Rollbar.info("log some info message");
Rollbar.error("log some error message");
Rollbar.warning("simple warning message");

// Add advanced data that will appear within the logs
Rollbar.info("some log message", { data: "hello", example: "more data" });

// Log with an entire JavaScript object as additional data
// This example will log the entire iViewer device details as per our JS API
// http://www.commandfusion.com/docs/scripting/globals.html#cF.device
Rollbar.info("Sending iViewer details...", CF.device);

For more examples, see Rollbar docs for browser JS:
https://rollbar.com/docs/notifier/rollbar.js/#usage

About

Example showing how to log data from iViewer to the Rollbar cloud service.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published