Skip to content

Commit

Permalink
v0.7.9
Browse files Browse the repository at this point in the history
  • Loading branch information
philoskim committed Feb 20, 2021
1 parent cf61da3 commit 329d401
Show file tree
Hide file tree
Showing 15 changed files with 253 additions and 97 deletions.
134 changes: 130 additions & 4 deletions README.adoc
Expand Up @@ -49,14 +49,14 @@ To include `debux` in your project for development, simply add the following to

[source]
....
[philoskim/debux "0.7.8"]
[philoskim/debux "0.7.9"]
....

and this to your *production* dependencies.

[source]
....
[philoskim/debux-stubs "0.7.8"]
[philoskim/debux-stubs "0.7.9"]
....


Expand All @@ -65,6 +65,10 @@ and this to your *production* dependencies.
NOTE: You can see _All change logs since v0.3.0_
https://github.com/philoskim/debux/tree/master/doc/change-logs.adoc[here].

* v0.7.9
** `set-debug-level!` added. See the details <<set-debug-level, here>>.
** `set-line-bullet!` added. See the details <<set-line-bullet, here>>.
* v0.7.8
** `set-cljs-devtools!` added. See the details <<set-cljs-devtools, here>>.
** `cljs-devtools` dependency removed. _Debux_ no longer includes `cljs-devtools`
Expand Down Expand Up @@ -2241,6 +2245,7 @@ dbg: (-> "a b c d" .toUpperCase (.replace "A" "X") (.split " ") first) <thread
| :locals or :l | O | O | O | O | X
| :print or :p | O | X | O | X | X
| :dup | X | 0 | X | 0 | X
| :level | O | O | O | O | X
| :style or :s | X | X | O | O | X
| :once or :o | X | X | O | X | X
| :js | X | X | O | O | X
Expand Down Expand Up @@ -2779,6 +2784,82 @@ dbgn: (loop [acc 1 n 3] (if (zero? n) acc (recur (* acc n) (dec n)))) =>
| 6
----

[[set-debug-level]]
### `:level` option

You can set the debug level by using `set-debug-level!` and specify `:level` option as
follows. You can specify debug levels with any positive integers as you like.

[source]
.Example 1
....
;; The default debug level is 0.
(dbg (+ 10 20 5) :level 5)
(dbg (+ 10 20 3) :level 3)
(dbg (+ 10 20))
....

[listing]
.REPL output
----
{:ns examples.lab, :line 18}
dbg: (+ 10 20 5) =>
| 35
{:ns examples.lab, :line 19}
dbg: (+ 10 20 3) =>
| 33
{:ns examples.lab, :line 20}
dbg: (+ 10 20) =>
| 30
----

---

[source]
.Example 2
....
(set-debug-level! 3)
(dbg (+ 10 20 5) :level 5)
(dbg (+ 10 20 3) :level 3)
(dbg (+ 10 20))
....

[listing]
.REPL output
----
{:ns examples.lab, :line 23}
dbg: (+ 10 20 5) =>
| 35
{:ns examples.lab, :line 24}
dbg: (+ 10 20 3) =>
| 33
----

---

[source]
.Example 3
....
(set-debug-level! 5)
(dbg (+ 10 20 5) :level 5)
(dbg (+ 10 20 3) :level 3)
(dbg (+ 10 20))
....

[listing]
.REPL output
----
{:ns examples.lab, :line 28}
dbg: (+ 10 20 5) =>
| 35
----


[[style-option]]
### `:style` (or `:s`) option (CSS Styling: CLJS only)

Expand Down Expand Up @@ -3231,6 +3312,51 @@ dbgn: (* 10 (+ 2 3)) =>
| 50
----

[[set-line-bullet]]
## Setting the line bullet

You can change the default line bullet "`|`" by using `set-line-bullet!` as follows.

[source]
....
(set-line-bullet! ";")
(dbg (+ 20 30))
(dbgn (* 10 (+ 2 3)))
(set-line-bullet! " ")
(dbg (+ 20 30))
(dbgn (* 10 (+ 2 3)))
....


[listing]
.REPL output
----
{:ns examples.lab, :line 11}
dbg: (+ 20 30) =>
; 50
{:ns examples.lab, :line 12}
dbgn: (* 10 (+ 2 3)) =>
; (+ 2 3) =>
; 5
; (* 10 (+ 2 3)) =>
; 50
{:ns examples.lab, :line 17}
dbg: (+ 20 30) =>
50
{:ns examples.lab, :line 18}
dbgn: (* 10 (+ 2 3)) =>
(+ 2 3) =>
5
(* 10 (+ 2 3)) =>
50
----



[[temporal-turn-off]]
## Turning off the debux macros temporarily
Expand Down Expand Up @@ -3397,7 +3523,7 @@ an example about running the link:https://github.com/bhauman/lein-figwheel[figwh
(defproject examples "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.10.238"]
[philoskim/debux "0.7.8"]]
[philoskim/debux "0.7.9"]]
:plugins [[lein-cljsbuild "1.1.6"]
[lein-figwheel "0.5.10"]]
:source-paths ["src/clj"]
Expand Down Expand Up @@ -3574,6 +3700,6 @@ When you double-click on one of the open parentheses and the following string is


## License
Copyright © 2015--2020 Young Tae Kim
Copyright © 2015--2021 Young Tae Kim

Distributed under the Eclipse Public License either version 1.0 or any later version.
4 changes: 4 additions & 0 deletions doc/change-logs.adoc
Expand Up @@ -3,6 +3,10 @@
:source-highlighter: coderay
:sectnums:

* v0.7.9
** `set-debug-level!` added.
** `set-line-bullet!` added.
* v0.7.8
** `set-cljs-devtools!` added.
** `cljs-devtools` dependency removed. _Debux_ no longer includes `cljs-devtools`
Expand Down
2 changes: 1 addition & 1 deletion examples/project.clj
Expand Up @@ -2,7 +2,7 @@
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.10.238"]
[org.clojure/core.async "0.3.465"]
[philoskim/debux "0.7.8"]]
[philoskim/debux "0.7.9"]]
:plugins [[lein-cljsbuild "1.1.7"]
[lein-figwheel "0.5.18"]]
:source-paths ["src/clj" "src/cljc"]
Expand Down
13 changes: 6 additions & 7 deletions examples/src/clj/examples/core.clj
Expand Up @@ -11,13 +11,12 @@

;; You should require dynamically the namespaces that you want to laod
;; if you want to use set-ns-blacklist! or set-ns-whitelist!.
(d/set-line-bullet! ";")

;(require 'examples.common)
;(require 'examples.dbg)
;(require 'examples.dbgn)
;(require 'examples.options)
;(require 'examples.etc)
(require 'examples.common)
(require 'examples.dbg)
(require 'examples.dbgn)
(require 'examples.options)
(require 'examples.etc)
;(require 'examples.demo)
(require 'examples.lab)
;(require 'examples.lab)
)
34 changes: 34 additions & 0 deletions examples/src/clj/examples/etc.clj
Expand Up @@ -41,3 +41,37 @@
(set-source-info-mode! true)
(dbg (+ 20 30))
(dbgn (* 10 (+ 2 3)))


;;; set-line-bullet!
(dbg (+ 20 30))
(dbgn (* 10 (+ 2 3)))

(set-line-bullet! ";")

(dbg (+ 20 30))
(dbgn (* 10 (+ 2 3)))


(set-line-bullet! " ")

(dbg (+ 20 30))
(dbgn (* 10 (+ 2 3)))

(set-line-bullet! "|")


;;; set-debug-level!
(dbg (+ 10 20 5) :level 5)
(dbg (+ 10 20 3) :level 3)
(dbg (+ 10 20)) ;; default debug level is `0`.

(set-debug-level! 3)
(dbg (+ 10 20 5) :level 5)
(dbg (+ 10 20 3) :level 3)
(dbg (+ 10 20))

(set-debug-level! 5)
(dbg (+ 10 20 5) :level 5)
(dbg (+ 10 20 3) :level 3)
(dbg (+ 10 20))
22 changes: 0 additions & 22 deletions examples/src/clj/examples/lab.clj
Expand Up @@ -2,25 +2,3 @@

(use 'debux.core)


;; (set-line-bullet! ";")

;; (dbg (+ 20 30))
;; (dbgn (* 10 (+ 2 3)))


;; (set-line-bullet! " ")

;; (dbg (+ 20 30))
;; (dbgn (* 10 (+ 2 3)))


;(set-debug-level! 5)

(dbg (+ 20 30) :level 5)
(dbg (+ 20 30) :level 3)
(dbg (+ 20 30))

(dbgn (* 10 (+ 2 3)) :level 5)
(dbgn (* 10 (+ 2 3)) :level 3)
(dbgn (* 10 (+ 2 3)))
16 changes: 8 additions & 8 deletions examples/src/cljs/examples/core.cljs
@@ -1,12 +1,12 @@
(ns examples.core
(:require ;examples.common
;examples.clogn
;examples.clog
;examples.dbgn
;examples.dbg
;examples.options
;examples.etc
(:require examples.common
examples.clogn
examples.clog
examples.dbgn
examples.dbg
examples.options
examples.etc
;examples.demo
examples.lab
;examples.lab
))

53 changes: 53 additions & 0 deletions examples/src/cljs/examples/etc.cljs
Expand Up @@ -60,3 +60,56 @@
(filter odd?)
(clog-last_ 5 "after filter")
(map inc))



;;; set-source-info-mode!
(d/set-source-info-mode! false)

(dbg (+ 2 3))
(dbgn (* 10 (+ 2 3)))

(clog (+ 2 3))
(clogn (* 10 (+ 2 3)))


(d/set-source-info-mode! true)

(dbg (+ 20 30))
(dbgn (* 10 (+ 2 3)))

(clog (+ 20 30))
(clogn (* 10 (+ 2 3)))


;;; set-line-bullet!
(d/set-line-bullet! ";")

(dbg (+ 20 30))
(dbgn (* 10 (+ 2 3)))

(clog (+ 20 30))
(clogn (* 10 (+ 2 3)))


(d/set-line-bullet! " ")

(dbg (+ 20 30))
(dbgn (* 10 (+ 2 3)))

(d/set-line-bullet! "|")


;;; set-debug-level!
(clog (+ 20 30))
(clogn (* 10 (+ 2 3)))

(d/set-debug-level! 5)

(clog (+ 20 30) :level 5)
(clog (+ 20 30) :level 3)
(clog (+ 20 30))

(clogn (* 10 (+ 2 3)) :level 5)
(clogn (* 10 (+ 2 3)) :level 3)
(clogn (* 10 (+ 2 3)))

0 comments on commit 329d401

Please sign in to comment.