How to view logs and reports with Wowza GoCoder SDK for Android

Learn how to collect device information, status and error reports, and logs with Wowza GoCoder™ SDK for Android.

Contents


Collect device and SDK information (video)
Collect status and error reports
Collect logs
More resources

Collect device and SDK information (video)


Watch this video to see how to collect the device and SDK information for your setup.

Use the SDK_VERSION and PLATFORM_INFO APIs in the WowzaGoCoder class, respectively, to get information about the Wowza GoCoder SDK version and the device running the app.

// Get the SDK version information
WOWZLog.info(TAG, "SDK Version Information: " + WowzaGoCoder.SDK_VERSION);
// Get the device and platform information
WOWZLog.info(TAG, "Platform and Device Information: " + WowzaGoCoder.PLATFORM_INFO);

Collect status and error reports


Many of the Wowza GoCoder SDK APIs use instances of the WOWZStatus class to return the status of components and processes. The WOWZStatus class contains two properties:

  • State indicates that a component, such as a broadcast stream, is running or stopped.
  • Error indicates that an error occurred. The getLastError() method in the WOWZStatus class returns an instance of the WOWZError class.

The following example shows how to check the status for an error:

// Get the SDK status and check for an error
if (mGoCoder.getStatus == WOWZState.IDLE && mGoCoder.getStatus.getLastError() != null) {
  WOWZLog.error(TAG, "An SDK error occurred: " + mGoCoder.getStatus.getLastError().getErrorDescription());
}

Collect logs


Use the WOWZLog class to send log messages at various levels. In its default configuration, WOWZLog is a wrapper class for the Android SDK Log utility class. You can also use the WOWZLogger interface to integrate the Wowza GoCoder SDK with other logging facilities.

The following example shows how to extend the WOWZLogger interface to wrap the SysLogger class:

// A custom logger class for the GoCoder SDK
public class MyLogger extends WZLogger {

   public MyLogger() {
   }

   @Override
   public void info(String tag, String message) {
    SysLogger.i(tag, message);
   }
   @Override
   public void debug(String tag, String message) {
    SysLogger.d(tag, message);
   }

   @Override
   public void warn(String tag, String message) {
    SysLogger.w(tag, message);
   }

   @Override
   public void error(String tag, String message) {
     SysLogger.e(tag, message);
   }

   @Override
   public void error(String tag, String message, Throwable throwable) {
     SysLogger.e(tag, message, throwable);
   }

   @Override
   public void error(String tag, Throwable throwable) {
     SysLogger.e(tag, throwable);
   }
}

// Create an instance of the custom logger class
MyLogger customLogger = new MyLogger();
// Register the instance with the SDK logger
WOWZLog.registerLogger(customLogger);

More resources



If you're having problems or want to discuss this article, post in our forum.