     // Disconnect from current session, browse for another host
     public func disconnect() {
         session.disconnect()
-        NSLog("%@", "disconnected from \(session.hashValue)")
+        DLog("%@", "disconnected from \(session.hashValue)")
     }
     
     // This method is async
     public func sendData(data: NSData, mode: MCSessionSendDataMode) -> Bool {
         do {
-            NSLog("%@", "send data to host: \(data)")
+            DLog("%@", "send data to host: \(data)")
             try session.sendData(data, toPeers: session.connectedPeers, withMode: mode)
         } catch {
-            NSLog("%@", "send data failed: \(data)")
+            DLog("%@", "send data failed: \(data)")
             return false
         }
         
         return true
+    }
+    
+    // Debug mode
+    private func DLog(message: String, _ function: String) {
+        if debugMode {
+            NSLog(message, function)
+        }
     }
 }
 

                return
            }
            
            NSLog("%@", "invitePeer: \(peerID)")
            foundHosts.append(peerID)
            delegate?.foundHostsChanged(foundHosts)
    }

}

public class CoulombNetwork: NSObject {
    public var debugMode = false
    public var autoAcceptGuests = true
    
    static let defaultTimeout: NSTimeInterval = 30
