         return retVal.toJSON() ?? ""
     }
     
-    private func mergeOptions(from error:NSError, to dictionary: inout [String:Any], policy: KeyMergePolicy = .override) {
+    private func mergeOptions(from error:NSError, to dictionary: inout [String:Any], policy: KeyMergePolicy = .encapsulateFlatten) {
         let errorInfo = [errorDomain: error.domain,
                          errorCode: error.code] as [String : Any]
         let errorUserInfo = error.humanReadableError().userInfo as! [String : Any]

        }
        
        if let error = error {
            let keyMergePolicy: KeyMergePolicy = self.eventLogingPolicy == .singleEvent ? .override : .encapsulateFlatten
            error.errorChain().forEach({ (underlyingError) in
                mergeOptions(from: underlyingError, to: &options, policy: keyMergePolicy)
            })

    public enum ErrorLoggingPolicy {
        case singleEvent
        case multipleEvents
    }
    
    internal enum LogType {
        case debug
        case warning
        case verbose
        case error
        case info
    }
    
    public var logTypeKey = "log_type"
