関数をトレースするとき、引数の1つが多数の要素を含むネストされたマップである場合、トレースはクラッタで埋められます。典型的な例を次に示します:引数が大きなマップの場合のトレース関数
TRACE t36705: (get-value {:nodeclass :simple, :nodeid :simple25, :dock {:constan
t-dock {:name :constant-dock, :value 22, :dockclass {:name :constant-dock, :link
-policy {:lp-committed? #object[fargish.links$fn__5756 0x407956a5 "fargish.links
[email protected]"], :lp-reciprocate-no-commitment #object[clojure.core$constan
tly$fn__4614 0x69497a36 "[email protected]"], :lp-recipr
ocate-commitment #object[clojure.core$constantly$fn__4614 0x30ee413a "clojure.co
[email protected]"], :lp-can-boost-to #object[fargish.links$fn__57
58 0x5df17e60 "[email protected]"], :lp-official-partners #object[
fargish.links$fn__5760 0x3df2f4ab "[email protected]"], :lp-normal
ize-after-add #object[clojure.core$constantly$fn__4614 0x386cc1c4 "clojure.core$
[email protected]"], :lp-reduce-to-uncommitted #object[fargish.links$
fn__5765 0x7bd4f212 "[email protected]"], :lp-committed-to #object
[fargish.links$fn__5767 0x5c3cc103 "[email protected]"], :lp-boost
#object[fargish.links$fn__5771 0x423e35f0 "[email protected]"]},
:maker #object[fargish.spec_test$eval36501$__GT_Dock_constant_dock__36515 0x19cc
229b "[email protected]29b"]}}, :
function-dock {:name :function-dock, :value #fargish.spec.Vfunc{:args (constant-
dock), :f #object[fargish.spec_test$fn__36544 0x135647d3 "fargish.spec_test$fn__
[email protected]"]}, :dockclass {:name :function-dock, :link-policy {:lp-committed
? #object[fargish.links$fn__5756 0x407956a5 "[email protected]"],
:lp-reciprocate-no-commitment #object[clojure.core$constantly$fn__4614 0x69497a3
6 "[email protected]"], :lp-reciprocate-commitment #obje
ct[clojure.core$constantly$fn__4614 0x30ee413a "clojure.core$constantly$fn__4614
@30ee413a"], :lp-can-boost-to #object[fargish.links$fn__5758 0x5df17e60 "fargish
[email protected]"], :lp-official-partners #object[fargish.links$fn__5760
0x3df2f4ab "[email protected]"], :lp-normalize-after-add #object[
clojure.core$constantly$fn__4614 0x386cc1c4 "[email protected]
6cc1c4"], :lp-reduce-to-uncommitted #object[fargish.links$fn__5765 0x7bd4f212 "f
[email protected]"], :lp-committed-to #object[fargish.links$fn__576
7 0x5c3cc103 "[email protected]"], :lp-boost #object[fargish.links
$fn__5771 0x423e35f0 "[email protected]"]}, :maker #object[fargish
.spec_test$eval36523$__GT_Dock_function_dock__36537 0x34584446 "fargish.spec_tes
[email protected]"]}}}} constant-dock)
TRACE t36705: => nil
これらのトレースがあまりにもぎこちなく印刷されるように設定するテクニックは何ですか?私はトレースを読むのが簡単すぎるとは思っていませんが、これよりも良い方法が必要です。
['* print-level *'](https://clojure.github.io/clojure/branch-clojure-1.6.0/clojure.core-api.html#clojure.core)を使いこなしてみましたか?/*印刷レベル*)? – Alex
どのようにトレースを設定しますか?どのような問題を解決しようとしていますか?たぶん良いツールがあるかもしれませんが、それはあなたの特定のケースに依存します。 –
@Alex私は何か間違っているかもしれませんが、 'print-level *'と 'print-length *'は 'clojure.trace'には何の影響も与えないようです。私は主に 'lein test-refresh:with-repl'を使用しています。 –