     }
 
     func socket(sock: GCDAsyncSocket!, didWriteDataWithTag tag: Int) {
+        #if DEBUG
         NSLog("CocoaMQTT: Socket write message with tag: \(tag)")
+        #endif
     }
 
     func socket(sock: GCDAsyncSocket!, didReadData data: NSData!, withTag tag: Int) {

    }

    func didReceivePubComp(reader: CocoaMQTTReader, msgid: UInt16) {
        NSLog("CocoaMQTT: PUBCOMP Received: \(msgid)")
    }

    func didReceiveSubAck(reader: CocoaMQTTReader, msgid: UInt16) {
        NSLog("CocoaMQTT: SUBACK Received: \(msgid)")
        if let topic = subtopics.removeValueForKey(msgid) {
            delegate?.mqtt(self, didSubscribeTopic: topic)
        }
    }

    func didReceiveUnsubAck(reader: CocoaMQTTReader, msgid: UInt16) {
        NSLog("CocoaMQTT:UNSUBACK Received: \(msgid)")
        if let topic = subtopics.removeValueForKey(msgid) {
            delegate?.mqtt(self, didUnsubscribeTopic: topic)
        }
    }

    func didReceivePong(reader: CocoaMQTTReader) {
        NSLog("CocoaMQTT:PONG Received")
        delegate?.mqttDidReceivePong(self)
    }



    func didReceiveConnAck(reader: CocoaMQTTReader, connack: UInt8) {
        connState = CocoaMQTTConnState.CONNECTED
        #if DEBUG
        NSLog("CocoaMQTT: CONNACK Received: \(connack)")
        #endif
        
        //keep alive
        if keepAlive > 0 {
            aliveTimer = MSWeakTimer.scheduledTimerWithTimeInterval(
