         return logArray.count
     }
     
+    @IBAction func clearLogButton(sender: AnyObject) {
+        let FILE = "mfpsdk.logger.log"
+        let PATH = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] + "/"
+        let pathToFile = PATH + FILE
+        do {
+            try NSFileManager().removeItemAtPath(pathToFile)
+        } catch {
+            
+        }
+    }
+    @IBAction func updateLogText(sender: AnyObject) {
+        let FILE = "mfpsdk.logger.log"
+        let PATH = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] + "/"
+        let pathToFile = PATH + FILE
+        var formattedContents:String?
+        
+        do {
+            formattedContents = try String(contentsOfFile: pathToFile, encoding: NSUTF8StringEncoding)
+            if(formattedContents != nil){
+                formattedContents = formattedContents!
+                let fileContents = "[\(formattedContents)]"
+                logText.text = fileContents
+            } else {
+                logText.text = "Empty Log"
+            }
+            
+        } catch {
+                logText.text = "Empty Log"
+        }
+//        let formattedContents = try! String(contentsOfFile: pathToFile, encoding: NSUTF8StringEncoding)
+        
+//        let fileContents = "[\(formattedContents)]"
+  //      logText.text = fileContents
+        
+    }
     // The data to return for the row and component (column) that's being passed in
     func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
         return logArray[row]
+    }
+    
+    func JSONString(var str: String) -> String {
+        // \b = \u{8}
+        // \f = \u{12}
+        let insensitive = NSStringCompareOptions.CaseInsensitiveSearch
+        str = str
+            .stringByReplacingOccurrencesOfString("\"", withString: "\\\"", options: insensitive)
+            .stringByReplacingOccurrencesOfString("/", withString: "\\/", options: insensitive)
+            .stringByReplacingOccurrencesOfString("\n", withString: "\\n", options: insensitive)
+            .stringByReplacingOccurrencesOfString("\u{8}", withString: "\\b", options: insensitive)
+            .stringByReplacingOccurrencesOfString("\u{12}", withString: "\\f", options: insensitive)
+            .stringByReplacingOccurrencesOfString("\r", withString: "\\r", options: insensitive)
+            .stringByReplacingOccurrencesOfString("\t", withString: "\\t", options: insensitive)
+        return str;
     }
     
     func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {

//
//  LogController.swift
//  BMSCore
//
//  Created by Nana on 11/17/15.
//  Copyright © 2015 IBM. All rights reserved.
//

import UIKit
import BMSCore

      
    }
    
    
    
    
    @IBAction func crashAppButton(sender: AnyObject){
        let e = NSException(name:"crashApp", reason:"No reason at all just doing it for fun", userInfo:["user":"nana"])
        e.raise()
