blackberry.com
BlackBerry Dynamics
Runtime library for macOS applications
from the application developer portal
Public Member Functions | Static Public Member Functions | Properties

GDLogManager Class Reference

BlackBerry Dynamics log manager. More...

#import <GDLogManager.h>

List of all members.

Public Member Functions

Static Public Member Functions

Properties


Detailed Description

This class contains a number of programming interfaces for managing BlackBerry Dynamics activity logs.

The BlackBerry Dynamics runtime logs its activity to files in the secure store on the device. The application can use the programming interface in this class to:

Notifications for user interface update

In the case that the application implements a custom user interface, it can be notified of progress by the BlackBerry Dynamics runtime. A notification will be dispatched by the runtime when there is any change to the upload state, or to the amount of data uploaded. For example, a notification would be dispatched when:

When a notification is received, the application code could determine the new status and then update the user interface accordingly, for example:

The following mechanisms are supported for notifications.

To use KVO, observe the properties of the GDLogManager interface object, which is a singleton. The properties to observe are:

To use NSNotificationCenter:

See also:
NSNotificationCenter class reference in the Apple API Reference on the apple.com developer website.
Key-Value Observing Programming Guide on the apple.com developer website.
BlackBerry Dynamics runtime activity log.

Member Function Documentation

+ (instancetype) sharedInstance

This function returns a reference to the BlackBerry Dynamics activity log manager object. The activity log manager is a "singleton class".

Returns:
Reference that can be used to call, for example, the startUpload function.
- (BOOL) startUpload

Call this function to upload the current activity log files for support purposes. The logs will be uploaded to a server in the BlackBerry Dynamics Network Operation Center (NOC).

BlackBerry Dynamics support staff have access to the server to which log files are uploaded, and can use the data for support analysis.

This function can be used to upload logs even if BlackBerry Dynamics authorization has failed. The user identifier with which the application was activiated will be needed by support staff, to identify uploaded files. The user identifier is typically the end user's enterprise email address. If authorization has failed or been cancelled without a user identifier being successfully entered, then no logs will be uploaded.

The upload takes place in background and will be retried as necessary by the runtime. Progress can be monitored and managed by using the programming interface of this class.

The runtime makes a copy of its current activity log files when this function is called. The copy is retained until upload completes or is cancelled. If an earlier log upload is still in progress when this function is called, the current activity log files are added to the in-progress upload.

Returns:
YES if upload was started OK.
NO otherwise or if this application is in the Wiped state.
- (BOOL) cancelUpload

Call this function to cancel the upload of activity logs, which would have been started by calling GDLogManager::startUpload. Upload cannot be resumed after cancellation.

Returns:
YES if upload was cancelled OK.
NO otherwise or if this application is in the Wiped state.
- (BOOL) suspendUpload

Call this function to suspend the upload of activity logs, which would have been started by calling GDLogManager::startUpload. Upload can be resumed after suspension.

Returns:
YES if upload was suspended OK.
NO otherwise or if this application is in the Wiped state.
- (BOOL) resumeUpload

Call this function to resume the upload of activity logs after suspension. Upload would have been suspended by calling GDLogManager::suspendUpload.

Returns:
YES if upload was resumed OK.
NO otherwise or if this application is in the Wiped state.
- (BOOL) detailedLoggingFor: (NSTimeInterval)  duration

Call this function to switch on detailed logging by the BlackBerry Dynamics runtime.

The runtime writes more messages to its activity log if detailed logging is switched on. Detailed logging slows down the runtime, and increases the amount of device storage occupied by the activity logs in the secure store. For these reasons, detailed logging can only be switched on by the application for a specified duration, and there is a maximum allowed duration. The maximum duration is 15 minutes and is given by the GDLogManager::GDLogManagerDetailedMaximumDuration constant.

Detailed activity logging can also be switched on by the BlackBerry Dynamics management console, in which there are a number of options. Check the user interface and documentation of the management console for details.

The ability to switch on detailed logging from the application code can be blocked by enterprise policy. See the GDAppConfigKeyPreventUserDetailedLogs item in the collection returned by the getApplicationConfig (GDMac) function.

Detailed activity logging can be switched off by the application code, if it was switched on by the application code. If detailed logging is switched on by the managment console then it cannot be switched off by the application code. Switch off detailed logging by calling this function and passing zero or a negative duration.

Parameters:
durationNSTimeInterval representation of the duration for which detailed logging is to be switched on, in seconds.
Pass zero or a negative number to switch off detailed logging.
Returns:
YES if the parameter value is less than or equal to the maximum allowed duration.
NO otherwise.
See also:
BlackBerry Dynamics runtime activity log for background. This function relates to the Container Log, not the Console Log.
NSTimeInterval reference in the Apple API Reference on the apple.com developer website.

Property Documentation

- (GDLogUploadState) uploadState [read, assign]
Returns:
GDLogUploadState value representing the current upload state.
- (NSInteger) uploadBytesSent [read, assign]
Returns:
NSInteger representing the amount of data sent so far, in bytes.
- (NSInteger) uploadBytesTotal [read, assign]
Returns:
NSInteger representing the total data to be sent, in bytes.

The documentation for this class was generated from the following file: