 
 (defonce handler-pool (handlers/mk-handler-pool "Overtone Event Handlers"))
 (defonce event-debug* (atom false))
+
+(defn- log-event
+  "Log event on separate thread to ensure logging doesn't interfere with
+  event handling latency"
+  [msg & args]
+  (future (apply log/debug msg args)))
 
 (defn on-event
   "Asynchronously runs handler whenever events of event-type are

  Handlers can return :overtone/remove-handler to be removed from the
  handler list after execution."
  [event-type handler key]
  (log/debug "Registering sync event handler:: " event-type key)
  (handlers/add-sync-handler! handler-pool event-type key handler))

(defn oneshot-event
  ""
  [event-type handler key]
  (log/debug "Registering async self-removing event handler:: " event-type key)
  (handlers/add-one-shot-handler! handler-pool event-type key handler))

(defn oneshot-sync-event
  ""
  [event-type handler key]
  (log/debug "Registering sync self-removing event handler:: " event-type key)
  (handlers/add-one-shot-sync-handler! handler-pool event-type key handler))

(defn remove-handler

  [key]
  (handlers/remove-handler! handler-pool key))

(defn remove-all-handlers
  "Remove all handlers."
  []
