Skip to content

Instantly share code, notes, and snippets.

@Peeja
Created September 24, 2016 16:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Peeja/b347db21c552822fbc307973d4765e1e to your computer and use it in GitHub Desktop.
Save Peeja/b347db21c552822fbc307973d4765e1e to your computer and use it in GitHub Desktop.
Om Next parser middleware that adds logging for debugging
(defn logged-parser [parser]
(fn [env query target]
(js/console.groupCollapsed "parser:" (if target (str "(" target ")") ""))
(js/console.trace)
(js/console.debug (with-out-str (pprint query)))
(let [ret (parser env query target)]
(js/console.debug (with-out-str (pprint ret)))
(js/console.groupEnd)
ret)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment