     }
 
     func headerReady(header: UInt8) {
-        NSLog("header ready: \(header) ")
+        #if DEBUG
+        NSLog("CocoaMQTTReader: header ready: \(header) ")
+        #endif
         self.header = header
         readLength()
     }

    }

    func didReceivePublish(reader: CocoaMQTTReader, message: CocoaMQTTMessage, id: UInt16) {
        NSLog("CocoaMQTT: PUBLISH Received from \(message.topic)")
        delegate?.mqtt(self, didReceiveMessage: message, id: id)
        if message.qos == CocoaMQTTQOS.QOS1 {
            _puback(CocoaMQTTFrameType.PUBACK, msgid: id)

        case .PUBCOMP: descr = "PUBCOMP"
        default: assert(false)
        }
        #if DEBUG
        if descr != nil {
            NSLog("CocoaMQTT: Send \(descr!), msgid: \(msgid)")
        }
        #endif
        send(CocoaMQTTFramePubAck(type: type, msgid: msgid))
    }

    func didReceivePubAck(reader: CocoaMQTTReader, msgid: UInt16) {
        #if DEBUG
        NSLog("CocoaMQTT: PUBACK Received: \(msgid)")
        #endif
        if let message = messages[msgid] {
            messages.removeValueForKey(msgid)
            delegate?.mqtt(self, didPublishMessage: message, id: msgid)
