     
     internal static let logger = Logger.getLoggerForName(MFP_ANALYTICS_PACKAGE)
     
+    // Stores metadata (including a duration timer) for each app session
+    // An app session is roughly defined as the time during which an app is being used (from becoming active to going inactive)
     internal static var lifecycleEvents: [String: AnyObject] = [:]
     
     
     
     // MARK: Methods (public)
     
+    /**
+        Write analytics data to file. 
+    
+        Similar to the `Logger` class logging methods, old logs will be removed if the file size exceeds the `Logger.maxLogStoreSize` property.
+    
+        When ready, use the `Analytics.send()` method to send the logs to the Bluemix server.
+    
+         - parameter metadata:  The analytics data
+    */
     public static func log(metadata: [String: AnyObject]) {
         
         logger.analytics(metadata)
     }
     
     
+    /**
+        Send the accumulated analytics logs to the Bluemix server.
+    
+        Analytics logs can only be sent if the BMSClient was initialized via the `initializeWithBluemixAppRoute()` method.
+        
+        - parameter completionHandler:  Optional callback containing the results of the send request
+    */
     public static func send(completionHandler: MfpCompletionHandler? = nil) {
         
         Logger.sendAnalytics(completionHandler: completionHandler)
     }
     
     
+    // Log that the app is starting a new session, and start a timer to record the session duration
+    // This method should be called when the app starts up.
+    //      In iOS, this occurs when the app is about to enter the foreground.
+    //      In WatchOS, the user decides when this method is executed, but we recommend calling it when the app becomes active.
     dynamic static internal func logSessionStart() {
         
         if !lifecycleEvents.isEmpty {

    }
    
    
    dynamic static internal func logSessionEnd() {
        
        guard !lifecycleEvents.isEmpty else {
            logger.warn("The current app session ended before the start event was triggered, so the session cannot be recorded.")
            return
        }
        
        if let startTime = lifecycleEvents[KEY_EVENT_START_TIME] as? NSTimeInterval {
            let eventDuration = NSDate.timeIntervalSinceReferenceDate() - startTime
            lifecycleEvents[KEY_METADATA_DURATION] = eventDuration
            lifecycleEvents.removeValueForKey(KEY_EVENT_START_TIME)
            
            logger.analytics(lifecycleEvents)

*/


/**
    `Analytics` provides a means of capturing analytics data and sending the data to the Bluemix server.

    When this class's `enabled` property is set to `true` (which is the default value), all analytics data will be persisted to a file on the client device in the following JSON format:

        {
            "timestamp"    : "17-02-2013 13:54:27:123",     // "dd-MM-yyyy hh:mm:ss:S"
            "level"        : "ANALYTICS",
            "pkg"          : "mfpsdk.analytics",
            "msg"          : "",                            // Always an empty string for Analytics logs
            "metadata"     : {"some key": "some value"}     // Analytics data
        }

    Analytics data are accumulated persistently to the log file until the file size is greater than the `Logger.maxLogStoreSize` property. At this point, half of the old logs will be deleted to make room for new log data.

    Log file data is sent to the Bluemix server when this class's send() method is called, provided that the file is not empty and the BMSClient was initialized via the `initializeWithBluemixAppRoute()` method. When the log data is successfully uploaded, the persisted local log data is deleted.
*/
public class Analytics {
    
    
    // MARK: Properties (public)
    
    /// Determines whether analytics logs will be persisted to file.
    public static var enabled: Bool = true
    
    
