A Clojure trace tool. Defines tracing macros/fns to help you see what your code is doing.
Formerly known as clojure.contrib.trace.
See the tools.trace API Reference.
Latest stable release: 0.7.10
Leiningen dependency information:
[org.clojure/tools.trace "0.7.10"]
Maven dependency information:
<dependency>
<groupId>org.clojure</groupId>
<artifactId>tools.trace</artifactId>
<version>0.7.10</version>
</dependency>
=> (use 'clojure.tools.trace)
=> (trace (* 2 3)) ;; To trace a value
TRACE: 6
6
=> (trace "tag" (* 2 3)) ;; To trace a value and assign a trace tag
TRACE tag: 6
6
=> (deftrace fubar [x v] (+ x v)) ;; To trace a function call and its return value
=> (fubar 2 3)
TRACE t1107: (fubar 2 3)
TRACE t1107: => 5
5
=> (do (+ 1 3) (* 5 6) (/ 1 0))
ArithmeticException Divide by zero clojure.lang.Numbers.divide (Numbers.java:156)
=> (trace-forms (+ 1 3) (* 5 6) (/ 1 0)) ;; To identify which form is failing
ArithmeticException Divide by zero
Form failed: (/ 1 0)
clojure.lang.Numbers.divide (Numbers.java:156)
(trace-ns myown.namespace) ;; To dynamically trace/untrace all fns in a name space (untrace-ns myown.namespace)
(trace-vars myown.namespace/fubar) ;; To dynamically trace/untrace specific fns (untrace-vars myown.namespace/fubar)
Release 0.7.10 September 23, 2018:
Release 0.7.9 October 8, 2015:
Release 0.7.8 March 15, 2013:
Release 0.7.7 March 14, 2013:
Release 0.7.6 Aug 23, 2013:
Release 0.7.5 Dec 1, 2012:
Release 0.7.4 Dec 1, 2012:
Release 0.7.3 March 4, 2012:
Release 0.7.2 Feb. 20, 2012:
Release 0.7.1 on 2011-09-18
Changes from clojure.trace
Copyright (c) Stuart Sierra, Michel Salim, Luc Préfontaine, Jonathan Fischer Friberg, Michał Marczyk, Andy Fingerhut 2011-2018. All rights reserved. The use and distribution terms for this software are covered by the Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software.
Can you improve this documentation? These fine people already did:
Luc Préfontaine, Alex Miller & Tom FaulhaberEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close