 (ns yeller-timbre-appender
   (:require [yeller-clojure-client :as yeller-client]))
+
+(defn create-client [options]
+  (if-let [client (:yeller/client options)]
+    client
+    (yeller-client/client options)))
 
 (defn extract-data [throwable]
   (if-let [data (ex-data throwable)]

    {:token \"your token here\"})"
  ([options] (make-yeller-appender {} options))
  ([timbre-options options]
   (assert (string? (:token options)) "make-yeller-appender requires a token")
   (let [with-default (merge {:environment "production"} options)
         client (yeller-client/client options)]

     (merge
       {:doc "A timbre appender that sends errors to yellerapp.com"
        :min-level :warn

  "Create a Yeller timbre appender.
   (make-yeller-appender {:token \"YOUR API TOKEN HERE\"})
   Required options:
     either:
     :token \"your api token here\"
     OR
     :yeller/client an-existing-yeller-client
   The second option is for when you already use yeller somewhere else and
   only want one client in the codebase.
   Optional:
     :environment \"production\" ; the name of the environment the app runs in
  (note that exceptions reported in \"development\" or \"test\" environments
