cljs-devtools
- Better presentation of ClojureScript values in Chrome DevTools (custom formatters)
- More informative exceptions (sanity hints)
- Support for Dirac DevTools (dirac)
An example of formatting various ClojureScript data structures:
Scope view / drawer Console (toggle with ESC)
An example of a sanity hint:
Read more in v0.4.0 release notes.
Integration in your own project
Add devtools dependency into your Leiningen's project.clj
To install it. You have to call install!
from devtools.core
namespace. Ideally run this as early as possible during
launch time of your app.
(ns your-project.core
(:require [devtools.core :as devtools]))
; this enables additional features, :custom-formatters is enabled by default
(devtools/enable-feature! :sanity-hints :dirac)
(devtools/install!)
(.log js/console (range 200))
Check out the sample project.
Enable Custom formatters in Chrome
Available in Chrome 47 and higher.
- Open DevTools
- Go to Settings ("three dots" icon in the upper right corner of DevTools > Menu > Settings
F1
> General > Console) - Check-in "Enable custom formatters"
- Close DevTools
- Open DevTools
Note: You might need to refresh the page first time you open Console panel with existing logs - custom formatters are applied only on newly printed console messages.