This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-07
Channels
- # announcements (4)
- # babashka (20)
- # beginners (167)
- # calva (1)
- # cider (18)
- # circleci (10)
- # clara (45)
- # clojure (85)
- # clojure-argentina (1)
- # clojure-europe (3)
- # clojure-finland (3)
- # clojure-greece (2)
- # clojure-italy (9)
- # clojure-nl (30)
- # clojure-spec (32)
- # clojure-survey (39)
- # clojure-uk (72)
- # clojurescript (12)
- # core-async (4)
- # data-science (3)
- # emacs (10)
- # figwheel-main (9)
- # fulcro (44)
- # graalvm (3)
- # jobs (12)
- # jobs-discuss (6)
- # joker (3)
- # juxt (1)
- # leiningen (4)
- # off-topic (23)
- # planck (5)
- # re-frame (4)
- # reitit (2)
- # remote-jobs (1)
- # shadow-cljs (43)
- # spacemacs (8)
- # test-check (19)
- # tools-deps (21)
Has anyone ever had issues with logging maps in a browser console? If I try to log something like this:
(.log js/console "my print" {:a "here" :b true})
I get something like this:
my print {meta: null, cnt: 2, arr: Array(4), __hash: null, cljs$lang$protocol_mask$partition0$: 16647951, …}
meta: null
cnt: 2
arr: Array(4)
0: {ns: null, name: "a", fqn: "a", _hash: -2123407586, cljs$lang$protocol_mask$partition0$: 2153775105, …}
1: "here"
2: {ns: null, name: "b", fqn: "b", _hash: 1482224470, cljs$lang$protocol_mask$partition0$: 2153775105, …}
3: true
length: 4
__proto__: Array(0)
__hash: null
cljs$lang$protocol_mask$partition0$: 16647951
cljs$lang$protocol_mask$partition1$: 139268
__proto__: Object
Thanks!even works for multiple args:
cljs.user=> (prn "my print" {:a 1 :b 2})
"my print" {:a 1, :b 2}
Yeah, that works
Take a look at cljs-devtools
If you are using Figwheel for development, the devtools should be already included
We are using shadow cljs. It’s odd because everyone else on my team using this repo has had no issues with this.
make sure "enable custom formatters" is checked in your devtools section under console
@scot0530 I found wrapping all the params to (.log js/console ...)
inside (str ...)
takes care of that, but clunky. A good reason to (enable-console-print!)
to get access to (prn ...)
which doesn’t need the extra call.
That is good to know!
Yes, just note that this returns an opaque string vs cljs-devtools' "interactive" output (i.e. like regular console.log maps)
I use a lot of timbre/spy