diff --git a/Cartfile b/Cartfile index 3134e7b68..5441676f2 100644 --- a/Cartfile +++ b/Cartfile @@ -1,5 +1,4 @@ github "Alamofire/Alamofire" == 3.1.2 -github "DaveWoodCom/XCGLogger" == 3.1.1 github "Hearst-DD/ObjectMapper" == 1.0.1 github "rhodgkins/SwiftHTTPStatusCodes" == 2.0.1 github "daltoniam/Starscream" == 1.1.1 diff --git a/Cartfile.resolved b/Cartfile.resolved index a690d64c5..e49facbb3 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -2,5 +2,4 @@ github "Alamofire/Alamofire" "3.1.2" github "Hearst-DD/ObjectMapper" "1.0.1" github "daltoniam/Starscream" "1.1.1" github "rhodgkins/SwiftHTTPStatusCodes" "2.0.1" -github "DaveWoodCom/XCGLogger" "Version_3.1.1" github "tristanhimmelman/AlamofireObjectMapper" "2.1.3" diff --git a/WatsonDeveloperCloud.xcodeproj/project.pbxproj b/WatsonDeveloperCloud.xcodeproj/project.pbxproj index de3004a28..39e135380 100644 --- a/WatsonDeveloperCloud.xcodeproj/project.pbxproj +++ b/WatsonDeveloperCloud.xcodeproj/project.pbxproj @@ -110,7 +110,6 @@ 7A0F97041C232B96004C01C0 /* NSError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0F966E1C232B96004C01C0 /* NSError.swift */; }; 7A0F970A1C232B96004C01C0 /* CoreResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0F96761C232B96004C01C0 /* CoreResponse.swift */; }; 7A0F970B1C232B96004C01C0 /* HTTPMethods.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0F96771C232B96004C01C0 /* HTTPMethods.swift */; }; - 7A0F970C1C232B96004C01C0 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0F96781C232B96004C01C0 /* Log.swift */; }; 7A0F970D1C232B96004C01C0 /* MediaType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0F96791C232B96004C01C0 /* MediaType.swift */; }; 7A0F970E1C232B96004C01C0 /* NetworkUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0F967A1C232B96004C01C0 /* NetworkUtils.swift */; }; 7A0F970F1C232B96004C01C0 /* Transformation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0F967B1C232B96004C01C0 /* Transformation.swift */; }; @@ -145,13 +144,11 @@ 7A0F97391C232D02004C01C0 /* HTTPStatusCodes.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A0F97331C232D02004C01C0 /* HTTPStatusCodes.framework */; }; 7A0F973A1C232D02004C01C0 /* ObjectMapper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A0F97341C232D02004C01C0 /* ObjectMapper.framework */; }; 7A0F973B1C232D02004C01C0 /* Starscream.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A0F97351C232D02004C01C0 /* Starscream.framework */; }; - 7A0F973C1C232D02004C01C0 /* XCGLogger.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A0F97361C232D02004C01C0 /* XCGLogger.framework */; }; 7A0F973E1C232F14004C01C0 /* Alamofire.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7A0F97311C232D02004C01C0 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 7A0F973F1C232F14004C01C0 /* AlamofireObjectMapper.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7A0F97321C232D02004C01C0 /* AlamofireObjectMapper.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 7A0F97401C232F14004C01C0 /* HTTPStatusCodes.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7A0F97331C232D02004C01C0 /* HTTPStatusCodes.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 7A0F97411C232F14004C01C0 /* ObjectMapper.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7A0F97341C232D02004C01C0 /* ObjectMapper.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 7A0F97421C232F14004C01C0 /* Starscream.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7A0F97351C232D02004C01C0 /* Starscream.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 7A0F97431C232F14004C01C0 /* XCGLogger.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7A0F97361C232D02004C01C0 /* XCGLogger.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 7A19DC931C597B260082ED38 /* SpeechToTextConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A19DC921C597B260082ED38 /* SpeechToTextConstants.swift */; }; 7A19DC971C5980780082ED38 /* SpeechToTextTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A19DC951C5980720082ED38 /* SpeechToTextTests.swift */; }; 7A19DC9C1C5983390082ED38 /* SpeechSample.flac in Resources */ = {isa = PBXBuildFile; fileRef = 7A19DC991C5983390082ED38 /* SpeechSample.flac */; }; @@ -200,7 +197,6 @@ 7A0F97401C232F14004C01C0 /* HTTPStatusCodes.framework in CopyFiles */, 7A0F97411C232F14004C01C0 /* ObjectMapper.framework in CopyFiles */, 7A0F97421C232F14004C01C0 /* Starscream.framework in CopyFiles */, - 7A0F97431C232F14004C01C0 /* XCGLogger.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -333,7 +329,6 @@ 7A0F966E1C232B96004C01C0 /* NSError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSError.swift; sourceTree = ""; }; 7A0F96761C232B96004C01C0 /* CoreResponse.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreResponse.swift; sourceTree = ""; }; 7A0F96771C232B96004C01C0 /* HTTPMethods.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTTPMethods.swift; sourceTree = ""; }; - 7A0F96781C232B96004C01C0 /* Log.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = ""; }; 7A0F96791C232B96004C01C0 /* MediaType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaType.swift; sourceTree = ""; }; 7A0F967A1C232B96004C01C0 /* NetworkUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkUtils.swift; sourceTree = ""; }; 7A0F967B1C232B96004C01C0 /* Transformation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Transformation.swift; sourceTree = ""; }; @@ -348,7 +343,6 @@ 7A0F97331C232D02004C01C0 /* HTTPStatusCodes.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HTTPStatusCodes.framework; path = Carthage/Build/iOS/HTTPStatusCodes.framework; sourceTree = ""; }; 7A0F97341C232D02004C01C0 /* ObjectMapper.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjectMapper.framework; path = Carthage/Build/iOS/ObjectMapper.framework; sourceTree = ""; }; 7A0F97351C232D02004C01C0 /* Starscream.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Starscream.framework; path = Carthage/Build/iOS/Starscream.framework; sourceTree = ""; }; - 7A0F97361C232D02004C01C0 /* XCGLogger.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCGLogger.framework; path = Carthage/Build/iOS/XCGLogger.framework; sourceTree = ""; }; 7A19DC921C597B260082ED38 /* SpeechToTextConstants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SpeechToTextConstants.swift; path = WatsonDeveloperCloud/SpeechToText/SpeechToTextConstants.swift; sourceTree = ""; }; 7A19DC951C5980720082ED38 /* SpeechToTextTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SpeechToTextTests.swift; path = WatsonDeveloperCloud/SpeechToText/Tests/SpeechToTextTests.swift; sourceTree = ""; }; 7A19DC991C5983390082ED38 /* SpeechSample.flac */ = {isa = PBXFileReference; lastKnownFileType = file; path = SpeechSample.flac; sourceTree = ""; }; @@ -381,7 +375,6 @@ buildActionMask = 2147483647; files = ( 7A0F973A1C232D02004C01C0 /* ObjectMapper.framework in Frameworks */, - 7A0F973C1C232D02004C01C0 /* XCGLogger.framework in Frameworks */, 7A0F973B1C232D02004C01C0 /* Starscream.framework in Frameworks */, 7A0F96E91C232B96004C01C0 /* libopus.a in Frameworks */, 7A0F97371C232D02004C01C0 /* Alamofire.framework in Frameworks */, @@ -812,7 +805,6 @@ children = ( 7A0F96761C232B96004C01C0 /* CoreResponse.swift */, 7A0F96771C232B96004C01C0 /* HTTPMethods.swift */, - 7A0F96781C232B96004C01C0 /* Log.swift */, 7A0F96791C232B96004C01C0 /* MediaType.swift */, 7A0F967A1C232B96004C01C0 /* NetworkUtils.swift */, 7A0F967B1C232B96004C01C0 /* Transformation.swift */, @@ -829,7 +821,6 @@ 7A0F97331C232D02004C01C0 /* HTTPStatusCodes.framework */, 7A0F97341C232D02004C01C0 /* ObjectMapper.framework */, 7A0F97351C232D02004C01C0 /* Starscream.framework */, - 7A0F97361C232D02004C01C0 /* XCGLogger.framework */, ); name = Frameworks; sourceTree = ""; @@ -1100,7 +1091,6 @@ 7A0F970F1C232B96004C01C0 /* Transformation.swift in Sources */, 7A0F96CB1C232B96004C01C0 /* NaturalLanguageClassifier.swift in Sources */, 7A0F97121C232B96004C01C0 /* WatsonCoreConstants.swift in Sources */, - 7A0F970C1C232B96004C01C0 /* Log.swift in Sources */, 7ACB0D4C1C878D5400861CCC /* SpeechToTextWordAlternativeResult.swift in Sources */, 7A19DC931C597B260082ED38 /* SpeechToTextConstants.swift in Sources */, 7A0F96D71C232B96004C01C0 /* PersonalityInsightsError.swift in Sources */, diff --git a/WatsonDeveloperCloud/AlchemyVision/AlchemyVision.swift b/WatsonDeveloperCloud/AlchemyVision/AlchemyVision.swift index e1c5728fe..1eaffa902 100644 --- a/WatsonDeveloperCloud/AlchemyVision/AlchemyVision.swift +++ b/WatsonDeveloperCloud/AlchemyVision/AlchemyVision.swift @@ -135,15 +135,12 @@ public class AlchemyVision: AlchemyService { } NetworkUtils.performBasicAuthFileUpload(visionUrl, fileURL: urlObject.0!.url!, parameters: params, completionHandler: {response in - var error:NSError? + let fileManager = NSFileManager.defaultManager() do { try fileManager.removeItemAtPath(urlObject.0!.path) } - catch let catchError as NSError { - error = catchError - Log.sharedLogger.error("\(error)") - } + catch { } var imageKeywords = ImageKeyWords() if case let data as Dictionary = response.data { @@ -208,18 +205,14 @@ public class AlchemyVision: AlchemyService { } NetworkUtils.performBasicAuthFileUpload(visionUrl, fileURL: urlObject.0!.url!, parameters: params, completionHandler: {response in - var error:NSError? + let fileManager = NSFileManager.defaultManager() // delete temp file from documents directory do { - Log.sharedLogger.error(urlObject.0!.path) try fileManager.removeItemAtPath(urlObject.0!.path) } - catch let catchError as NSError { - error = catchError - Log.sharedLogger.error("\(error)") - } + catch { } if case let data as Dictionary = response.data { let imageFaceTags = Mapper().map(data) diff --git a/WatsonDeveloperCloud/AlchemyVision/Models/ImageFace.swift b/WatsonDeveloperCloud/AlchemyVision/Models/ImageFace.swift index e8d0d739c..e8c5e75b0 100644 --- a/WatsonDeveloperCloud/AlchemyVision/Models/ImageFace.swift +++ b/WatsonDeveloperCloud/AlchemyVision/Models/ImageFace.swift @@ -38,9 +38,6 @@ public struct ImageFace : Mappable { public init?(_ map: Map) {} public mutating func mapping(map: Map) { - - Log.sharedLogger.error("ERRRRRR \(map[""])") - height <- (map["height"], Transformation.stringToInt) width <- (map["width"], Transformation.stringToInt) positionX <- (map["positionX"], Transformation.anyObjectToInt) diff --git a/WatsonDeveloperCloud/LanguageTranslation/Tests/LanguageTranslationTests.swift b/WatsonDeveloperCloud/LanguageTranslation/Tests/LanguageTranslationTests.swift index f9e968465..8fad7928d 100644 --- a/WatsonDeveloperCloud/LanguageTranslation/Tests/LanguageTranslationTests.swift +++ b/WatsonDeveloperCloud/LanguageTranslation/Tests/LanguageTranslationTests.swift @@ -181,7 +181,6 @@ class LanguageTranslationTests: XCTestCase { guard error == nil else { XCTFail("Expected nil error.") - Log.sharedLogger.error("\(error)") creationExpectation.fulfill() deletionExpectation.fulfill() return diff --git a/WatsonDeveloperCloud/WatsonCore/Utilities/CoreResponse.swift b/WatsonDeveloperCloud/WatsonCore/Utilities/CoreResponse.swift index 80a65c716..223b46c09 100644 --- a/WatsonDeveloperCloud/WatsonCore/Utilities/CoreResponse.swift +++ b/WatsonDeveloperCloud/WatsonCore/Utilities/CoreResponse.swift @@ -125,8 +125,6 @@ public struct CoreResponse: Mappable, CustomStringConvertible { } } catch { - Log.sharedLogger.info("Non-JSON payload received") - // When binary data is received coreResponseDictionary.updateValue(data, forKey: "data") } @@ -141,7 +139,6 @@ public struct CoreResponse: Mappable, CustomStringConvertible { coreResponseDictionary.updateValue(NSHTTPURLResponse.localizedStringForStatusCode(response.statusCode), forKey: "responseInfo") } let coreResponse = Mapper().map(coreResponseDictionary)! - Log.sharedLogger.debug("\(coreResponse)") return coreResponse } diff --git a/WatsonDeveloperCloud/WatsonCore/Utilities/Log.swift b/WatsonDeveloperCloud/WatsonCore/Utilities/Log.swift deleted file mode 100644 index 03069938c..000000000 --- a/WatsonDeveloperCloud/WatsonCore/Utilities/Log.swift +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Copyright IBM Corporation 2015 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ - -import Foundation -import XCGLogger - -/// Singleton Log Helper which uses XCGLogger as its core functionality -/// To change the log level from defaults then update the swift compiler options with -DDEBUG to turn on verbose logging -/// You can temporarily update the otherLogFileLocation to place the log file at your discretion but please do not check it in -public class Log { - - // privates - internal static var fileName = "IBMWatsonLog.txt" - internal static var consoleLogLevel = XCGLogger.LogLevel.Info - internal static var fileLogLevel = XCGLogger.LogLevel.Error - internal static var otherLogFileLocation = "" - - //plist keys - private static let logfileNameKey = "Logfile name" - private static let consoleLogLevelKey = "Console log level" - private static let fileLogLevelKey = "File log level" - private static let logfileLocationKey = "Logfile location" - - /// a shared singleton logger - public static let sharedLogger: XCGLogger = { - let instance = XCGLogger() - instance.xcodeColorsEnabled = true - instance.xcodeColors = [ - .Verbose: .lightGrey, - .Debug: .darkGrey, - .Info: .darkGreen, - .Warning: .orange, - .Error: XCGLogger.XcodeColor(fg: UIColor.redColor(), bg: UIColor.whiteColor()), - .Severe: XCGLogger.XcodeColor(fg: UIColor.whiteColor(), bg: UIColor.redColor()) - ] - #if Debug - Log.consoleLogLevel = XCGLogger.LogLevel.Verbose - Log.fileLogLevel = XCGLogger.LogLevel.Verbose - #endif - - #if USE_NSLOG // Set via Build Settings, under Other Swift Flags - instance.removeLogDestination(XCGLogger.constants.baseConsoleLogDestinationIdentifier) - instance.addLogDestination(XCGNSLogDestination(owner: instance, identifier: XCGLogger.constants.nslogDestinationIdentifier)) - instance.logAppDetails() - #else - let docURL = NSURL(fileURLWithPath: Log.fileName, relativeToURL: Log.getLogDirectory()) - instance.setup(Log.consoleLogLevel, - showThreadName: true, - showLogLevel: true, - showFileNames: true, - showLineNumbers: true, - writeToFile: docURL, - fileLogLevel: Log.fileLogLevel) - #endif - - return instance - }() - - - /** - Gets the log document directory or uses the user defined log path. It will append log to either of the locations - - - returns: NSURL - */ - private static func getLogDirectory() -> NSURL { - - var logsPath = NSURL(fileURLWithPath: NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0]) - if(otherLogFileLocation.characters.count > 0) { - logsPath = NSURL(fileURLWithPath: otherLogFileLocation) - } - - logsPath = logsPath.URLByAppendingPathComponent("logs") - do { - try NSFileManager.defaultManager().createDirectoryAtPath(logsPath.path!, withIntermediateDirectories: true, attributes: nil) - } catch let error as NSError { - NSLog("Unable to create directory \(error.debugDescription)") - } - - return logsPath - } -} diff --git a/WatsonDeveloperCloud/WatsonCore/Utilities/NetworkUtils.swift b/WatsonDeveloperCloud/WatsonCore/Utilities/NetworkUtils.swift index 120d89eee..c5dc0c51a 100644 --- a/WatsonDeveloperCloud/WatsonCore/Utilities/NetworkUtils.swift +++ b/WatsonDeveloperCloud/WatsonCore/Utilities/NetworkUtils.swift @@ -55,19 +55,16 @@ public class NetworkUtils { - returns: The manipulated string for properly invoking the web call */ private static func buildHeader(contentType: ContentType = ContentType.JSON, accept: ContentType = ContentType.JSON, apiKey: String? = nil)-> [String: String] { - Log.sharedLogger.debug("Entered buildHeader") var header = Dictionary() if let localKey = apiKey { header.updateValue(localKey as String, forKey: _httpAuthorizationHeader )} guard (header.updateValue(contentType.rawValue, forKey: _httpContentTypeHeader) == nil) else { - Log.sharedLogger.error("Error adding Content Type in header") return [:] } guard (header.updateValue(accept.rawValue, forKey: _httpAcceptHeader) == nil) else { - Log.sharedLogger.error("Error adding Accept info in header") return [:] } @@ -84,12 +81,9 @@ public class NetworkUtils { */ public static func requestAuthToken(tokenURL: String, serviceURL: String, apiKey: String? = nil, completionHandler: (token: String?, error: NSError?) -> Void) { - Log.sharedLogger.debug("Entered requestAuthToken") - let parameters = ["url": serviceURL] Alamofire.request(.GET, tokenURL, parameters: parameters, headers: buildHeader(.URLEncoded, accept: .URLEncoded, apiKey: apiKey)) .responseString {response in - Log.sharedLogger.debug("Entered requestAuthToken.responseString") completionHandler(token: response.result.value, error: response.result.error) } } @@ -105,20 +99,15 @@ public class NetworkUtils { */ public static func performBasicAuthRequest(url: String, method: HTTPMethod = HTTPMethod.GET, parameters: [String: AnyObject]? = [:], contentType: ContentType = ContentType.JSON, accept: ContentType = ContentType.JSON, encoding: ParameterEncoding = ParameterEncoding.URL, apiKey:String? = nil, completionHandler: (returnValue: CoreResponse) -> Void) { - Log.sharedLogger.debug("Entered performBasicAuthRequest") - Alamofire.request(method, url, parameters: parameters, encoding: encoding, headers: buildHeader(contentType, accept:accept, apiKey: apiKey) ) // This will validate for return status codes between the specified ranges and fail if it falls outside of them .responseJSON {response in - Log.sharedLogger.debug("Entered performBasicAuthRequest.responseJSON") if(contentType == ContentType.JSON) { completionHandler( returnValue: CoreResponse.getCoreResponse(response)) } } .responseString {response in - Log.sharedLogger.debug("Entered performBasicAuthRequest.responseString") if(contentType == ContentType.Text) { completionHandler( returnValue: CoreResponse.getCoreResponse(response)) } } .responseData { response in - Log.sharedLogger.debug("Entered performBasicAuthRequest.responseData") if(contentType == ContentType.AUDIO_OPUS || contentType == ContentType.AUDIO_WAV || contentType == ContentType.AUDIO_FLAC) { @@ -137,11 +126,8 @@ public class NetworkUtils { */ public static func performRequest(url: String, method: HTTPMethod = HTTPMethod.GET, parameters: [String: AnyObject] = [:], completionHandler: (returnValue: CoreResponse) -> Void) { - Log.sharedLogger.debug("Entered performRequest") - Alamofire.request(method, url, parameters: parameters) .responseJSON { response in - Log.sharedLogger.debug("Entered performRequest.responseJSON") completionHandler( returnValue: CoreResponse.getCoreResponse(response)) } } @@ -158,8 +144,6 @@ public class NetworkUtils { */ public static func performBasicAuthFileUploadMultiPart(url: String, fileURLs: [String:NSURL], parameters: [String: AnyObject]=[:], apiKey: String? = nil, contentType: ContentType = ContentType.URLEncoded, accept: ContentType = ContentType.URLEncoded, completionHandler: (returnValue: CoreResponse) -> Void) { - Log.sharedLogger.debug("Entered performBasicAuthFileUploadMultiPart") - Alamofire.upload(Alamofire.Method.POST, url, headers: buildHeader(contentType, accept: accept, apiKey: apiKey), multipartFormData: { multipartFormData in for (key, value) in parameters { @@ -170,15 +154,12 @@ public class NetworkUtils { } }, encodingCompletion: { encodingResult in - Log.sharedLogger.debug("Entered performBasicAuthFileUploadMultiPart.encodingCompletion") switch encodingResult { case .Success(let upload, _, _): upload.responseJSON { response in - Log.sharedLogger.debug("Entered performBasicAuthFileUploadMultiPart.encodingCompletion.responseJSON") completionHandler(returnValue: CoreResponse.getCoreResponse(response)) } - case .Failure(let encodingError): - Log.sharedLogger.error("\(encodingError)") + case .Failure: break } } ) @@ -202,7 +183,6 @@ public class NetworkUtils { Alamofire.upload(Alamofire.Method.POST, appendedUrl, headers: buildHeader(ContentType.URLEncoded, accept:ContentType.URLEncoded, apiKey:apiKey), file: fileURL) .responseJSON { response in - Log.sharedLogger.debug("Entered performBasicAuthFileUpload.responseJSON") completionHandler( returnValue: CoreResponse.getCoreResponse(response)) } } @@ -244,9 +224,6 @@ public class NetworkUtils { if case let value as String = item.1 { newUrl = addOrUpdateQueryStringParameter(newUrl, key: item.0, value: value) } - else { - Log.sharedLogger.error("error in adding value to parameter \(item) to URL string") - } } return newUrl } diff --git a/WatsonDeveloperCloudTests/AuthenticationTests.swift b/WatsonDeveloperCloudTests/AuthenticationTests.swift index 177b1d4b6..3aa5167d7 100644 --- a/WatsonDeveloperCloudTests/AuthenticationTests.swift +++ b/WatsonDeveloperCloudTests/AuthenticationTests.swift @@ -71,9 +71,6 @@ class AuthenticationTests: XCTestCase { XCTAssertNotNil(fbAuthentication.token) XCTAssertNil(error) - - Log.sharedLogger.info("Received a Watson token \(fbAuthentication.token)") - facebookExpectation.fulfill() } @@ -119,9 +116,6 @@ class AuthenticationTests: XCTestCase { XCTAssertNil(fbAuthentication.token) XCTAssertNotNil(error) - - Log.sharedLogger.info("Received a Watson token \(fbAuthentication.token)") - facebookNegativeExpectation.fulfill() }