Skip to content

Instantly share code, notes, and snippets.

@eval
Created October 8, 2018 20:42
Show Gist options
  • Save eval/43e74e61807580757fa63e9f632c0816 to your computer and use it in GitHub Desktop.
Save eval/43e74e61807580757fa63e9f632c0816 to your computer and use it in GitHub Desktop.
{:paths
["."]
:deps
{org.clojure/clojurescript {:mvn/version "1.10.339"
#_#_:git/url "https://github.com/clojure/clojurescript.git"
#_#_:sha "6eedd0a08c49f7b0d4dcb30977b2fb38c90577bd"}}}
(ns foo
(:require [goog.log :as glog])
(:import goog.debug.Console))
(def logger
(glog/getLogger "app"))
(def console (goog.debug.Console.))
(defn workaround! []
(.setConsole goog.debug.Console js/console))
(defn -main [& args]
(.setCapturing console true)
(.setLevel logger goog.debug.Logger.Level.FINEST)
(when args
(workaround!))
(glog/error logger "some error"))
(set! *main-cli-fn* -main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment