      :author "Jeff Rose"}
   overtone.util.log
   (:import [java.util.logging Logger Level ConsoleHandler FileHandler
-            StreamHandler SimpleFormatter])
-  (:use [overtone.config store]))
+            StreamHandler Formatter LogRecord]
+           [java.util Date])
+  (:use [overtone.config store]
+        [clojure.pprint :only (pprint)]))
 
 ; Sets up some basic logging infrastructure and helpers for the project.
 
 (defonce LOGGER (Logger/getLogger "overtone"))
 
-(defonce LOG-APPEND false)
+(defonce LOG-APPEND true)
 (defonce LOG-CONSOLE (ConsoleHandler.))
 
 (def LOG-FILE-HANDLER (FileHandler. OVERTONE-LOG-FILE LOG-APPEND))

      (assert (contains? LEVELS lvl))
      (.setLevel LOGGER (lvl LEVELS)))))

(defn- print-handler []
  (let [formatter (SimpleFormatter.)]
    (proxy [StreamHandler] []
      (publish [msg] (println (.format formatter msg))))))


(defonce LOG-SETUP?
  (do
    (level DEFAULT-LEVEL)
    (.setFormatter LOG-FILE-HANDLER (log-formatter))
    (.addHandler LOGGER LOG-FILE-HANDLER)
    true))

