         }
     }
     
-    
     private static func logException(exception: NSException) {
         
         let logger = Logger.getLoggerForName(MFP_LOGGER_PACKAGE)


public enum LogLevel: Int {
    
    case Analytics = 1, Fatal, Error, Warn, Info, Debug, None
}



    
    
    // MARK: Log methods
    // TODO: Make use of the "error" parameter or remove it
    public func debug(message: String, error: ErrorType? = nil, file: String = __FILE__, function: String = __FUNCTION__, line: Int = __LINE__) {
        
        logMessage(message, level: LogLevel.Debug, error: error, calledFile: file, calledFunction: function, calledLineNumber: line)
    }
    
    
    public func info(message: String, error: ErrorType? = nil, file: String = __FILE__, function: String = __FUNCTION__, line: Int = __LINE__) {
    
        logMessage(message, level: LogLevel.Info, error: error, calledFile: file, calledFunction: function, calledLineNumber: line)
    }
    
    
    public func warn(message: String, error: ErrorType? = nil, file: String = __FILE__, function: String = __FUNCTION__, line: Int = __LINE__) {
        
        logMessage(message, level: LogLevel.Warn, error: error, calledFile: file, calledFunction: function, calledLineNumber: line)
    }
    
    
    public func error(message: String, error: ErrorType? = nil, file: String = __FILE__, function: String = __FUNCTION__, line: Int = __LINE__) {
        
        logMessage(message, level: LogLevel.Error, error: error, calledFile: file, calledFunction: function, calledLineNumber: line)
    }
    
    
    public func fatal(message: String, error: ErrorType? = nil, file: String = __FILE__, function: String = __FUNCTION__, line: Int = __LINE__) {
        
        logMessage(message, level: LogLevel.Fatal, error: error, calledFile: file, calledFunction: function, calledLineNumber: line)
    }
    
    
    internal func analytics(metadata: [String: AnyObject], error: ErrorType? = nil, file: String = __FILE__, function: String = __FUNCTION__, line: Int = __LINE__) {
        
        logMessage("", level: LogLevel.Analytics, error: error, calledFile: file, calledFunction: function, calledLineNumber: line, additionalMetadata: metadata)
    }
    
    
    internal func logMessage(message: String, level: LogLevel, error: ErrorType?, calledFile: String, calledFunction: String, calledLineNumber: Int, additionalMetadata: [String: AnyObject]? = nil) {
        
        // TODO: dispatch_async?
        
        guard canLogAtLevel(level) else {
            return
        }
        
        if level != LogLevel.Analytics {
            // Example: [DEBUG] [mfpsdk.logger] logMessage in Logger.swift:234 :: "Some random message"
            print("[\(level.stringValue)] [\(self.name)] \(calledFunction) in \(calledFile):\(calledLineNumber) :: \(message)")
        }
        
        var logFileName: String = Logger.logsDocumentPath
        var logOverflowFileName: String = Logger.logsDocumentPath
        if level == LogLevel.Analytics {
            logFileName += FILE_LOGGER_LOGS
            logOverflowFileName += FILE_LOGGER_OVERFLOW
        }
        else {
            logFileName += FILE_ANALYTICS_LOGS
            logOverflowFileName += FILE_ANALYTICS_OVERFLOW
        }
        
        
        
        let timeStamp = Logger.dateFormatter.stringFromDate(NSDate())
    }
    
    
    internal func canLogAtLevel(level: LogLevel) -> Bool {
        
        if level == LogLevel.Analytics && Analytics.enabled == false {
            return false
        }
        if level.rawValue <= Logger.logLevelFilter.rawValue {
            return false
        }
        return true
    }
    
    
    internal func writeToFile(fileName: String, string: String) {
