Liking cljdoc? Tell your friends :D

Clojure Debug

Repository

Clojars Project

Documentation

Install

Follow instructions on the Clojars page

Usage

On fn or defn append -input, -output, -io, -group or -group-io to wrap function to log stuff in the console

-(ns hello)
+(ns hello
+  (:use [debug.macro]))
 
-(defn my-function
+(defn-group-io my-function
   [arg]
   (do-stuff arg))

Check more on the documentation

CLJ

Just use :use, it will import everything in the scope

It's "dirty" but short and simple : perfect while debugging

-(ns hello)
+(ns hello
+  (:use [debug.print])
+  (:use [debug.macro]))

CLJS

In CLJS, it seems that we have to explicit refer to everything that we want to use

Looking for a shorter way contributions are welcome

-(ns hello)
+(ns hello
+  (:require
+   [debug.print :refer [pretty-print
+                        spy
+                        group-begin group-begin-collapsed group-end
+                        print-group]]
+   [debug.macro :refer-macros [fn-input fn-output
+                               fn-io fn-group fn-group-io
+                               defn-io defn-group defn-group-io
+                               defn-generate-test]]))

CLJC

Meld both CLJ and CLJS

Looking for a shorter way contributions are welcome

-(ns hello)
+(ns hello
+  (:require
+   [debug.print :refer [pretty-print
+                        spy
+                        group-begin group-begin-collapsed group-end
+                        print-group]]
+   [debug.macro
+    :refer [fn-input fn-output
+            fn-io fn-group fn-group-io
+            defn-io defn-group defn-group-io
+            defn-generate-test]
+    :refer-macros []]))

CLJR

Maybe it works, maybe it doesn't

I haven't tested it, i don't know how to test it

Contributions are welcome

Demo

Check the demo folder

Contributing

Any contributions (feedback, bug report, merge request ...) are welcome

Test

clojure -A:test-clj
./script/test-cljs.sh

Deploy a new version

git tag vX.Y.Z && git push origin vX.Y.Z

Backlog

  • Clojars
  • Backlog
    • [ ] docstring support
    • [ ] debug rum components
      • using why-did-you-render ?
      • in another package ?
    • [ ] fn-* macros, label should be optional
    • [ ] find a way to automatically inject without the need to add :use or :require

License

MIT License

Can you improve this documentation?Edit on GitLab

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close