         return WikipediaNetworking()
     }()
 
+    public var debugPerformance = false
+
+    private func logMessage(_ message: String) {
+        #if DEBUG
+        if self.debugPerformance {
+            print("WikipediaKit: \(message)")
+        }
+        #endif
+    }
+
     public static weak var sharedActivityIndicatorDelegate: WikipediaNetworkingActivityDelegate?
     
     let session = URLSession(configuration: URLSessionConfiguration.default)

    func loadJSON(urlRequest: URLRequest,
                  completion: @escaping (JSONDictionary?, WikipediaError?) -> ())
        -> URLSessionDataTask {
        
        #if DEBUG
            let startTime = NSDate()
            print("WikipediaKit: Fetching \(urlRequest.url!.absoluteString)")
        #endif
        
        var urlRequest = urlRequest

            WikipediaNetworking.sharedActivityIndicatorDelegate?.stop()

            #if DEBUG
                let endNetworkingTime = Date()
                let totalNetworkingTime: Double = endNetworkingTime.timeIntervalSince(startTime)
                self.logMessage("\(totalNetworkingTime) seconds for network retrieval")
            #endif

            if let error = error {
