Logging Tutorial

This tutorial will show you how to use the different logging features offered by RevTwo In-App Support.

  1. Open your RevTwoSample app in xcode and run it on your device or simulator.  When the app opens, you will see a list of tutorials.  Select the “Logging” tutorial.  This will open a screen that looks like this:
    logging screen shot
  2. Clicking on these four buttons will create a new log.  Give it a try.  Watch them print out in the xcode console.
  3. While the app is running, log into revtwo.com and go to the Developer tab.  You will see your app in the list.  Click on it to connect to your app.  
  4. After it connects, you will see some information about your device, and a list of widgets along the side.  Click on the log widget and you will see the log messages you just created.logging widget
  5. Back in xcode, you can see how to do this in LoggingViewController.m (under the tutorials folder).  Scroll down, and you will see the IBActions that are hooked to the buttons in the UI.  Logging in RevTwo uses the same syntax as NSLog.  This makes it easy to convert an existing app with just copy/paste.
    - (IBAction)doTraceLog:(id)sender { 
       R2Trace(@"Trace Log Message"); 
    - (IBAction)doErrorLog:(id)sender { 
       R2Error(@"Error Log Message"); 
    - (IBAction)doWarningLog:(id)sender { 
       R2Warn(@"Warning Log Message"); 
    - (IBAction)doDebugLog:(id)sender { 
       R2Debug(@"Debug Log Message"); 
  6. The last piece of code to point out, is the inclusion of RevTwo.h in LoggingViewController.h.  You will need to include the header file in any class you use RevTwo logging in.