     (delete-process floobits-python-agent))))
 
 (floobits-initialize)
+
+(defun floobits-debug-message (text &rest rest)
+  (if (eq floobits-debug t)
+    (apply 'message text rest)))
 
 (defun floobits-add-hooks ()
   (add-hook 'after-change-functions 'floobits-after-change nil nil)

  (dired floobits-share-dir))

(defun floobits-event-join (req)
  (message "%s" req)
  (message "%s joined the workspace"  (floo-get-item req 'username)))

(defun floobits-event-part (req)
  (message "%s" req)
  (message "%s left the workspace" (floo-get-item req 'username)))

(defun floobits-event-create_view (req)

    (message "filename does not exist for buffer %s" (floo-get-item req 'id)))))

(defun floobits-switch (text)
  (floobits-debug-message "%s" text)
  (let* ((json-key-type 'string)
    (req (json-read-from-string text))
    (event (floo-get-item req "name"))
