Skip to content

Commit 4c32731

Browse files
committed
Update README
1 parent d2768a4 commit 4c32731

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

README.md

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Thats what _pretty_ is for. It adds support for pretty output where it counts:
99
* Hex dump of binary data
1010
* Hex dump of binary deltas
1111
* Readable output for exceptions
12+
* Formatting data into columns
1213

1314
pretty is released under the terms of the Apache Software License 2.0.
1415

@@ -94,44 +95,46 @@ This is best explained by example; here's a `SQLException` wrapped inside two `R
9495

9596
```
9697
(.printStackTrace e)
97-
=> nil
9898
java.lang.RuntimeException: Request handling exception
99-
at user$make_exception.invoke(user.clj:6)
100-
at clojure.lang.AFn.applyToHelper(AFn.java:159)
101-
at clojure.lang.AFn.applyTo(AFn.java:151)
102-
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3458)
103-
at clojure.lang.Compiler$DefExpr.eval(Compiler.java:408)
104-
at clojure.lang.Compiler.eval(Compiler.java:6624)
99+
at user$make_exception.invoke(user.clj:30)
100+
at user$eval1322.invoke(NO_SOURCE_FILE:1)
101+
at clojure.lang.Compiler.eval(Compiler.java:6619)
105102
at clojure.lang.Compiler.eval(Compiler.java:6582)
106103
at clojure.core$eval.invoke(core.clj:2852)
107104
at clojure.main$repl$read_eval_print__6588$fn__6591.invoke(main.clj:259)
108105
at clojure.main$repl$read_eval_print__6588.invoke(main.clj:259)
109106
at clojure.main$repl$fn__6597.invoke(main.clj:277)
110107
at clojure.main$repl.doInvoke(main.clj:277)
111108
at clojure.lang.RestFn.invoke(RestFn.java:1096)
112-
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__876.invoke(interruptible_eval.clj:56)
109+
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__808.invoke(interruptible_eval.clj:56)
113110
at clojure.lang.AFn.applyToHelper(AFn.java:159)
114111
at clojure.lang.AFn.applyTo(AFn.java:151)
115112
at clojure.core$apply.invoke(core.clj:617)
116113
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1788)
117114
at clojure.lang.RestFn.invoke(RestFn.java:425)
118115
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:41)
119-
at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__917$fn__920.invoke(interruptible_eval.clj:171)
116+
at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__849$fn__852.invoke(interruptible_eval.clj:171)
120117
at clojure.core$comp$fn__4154.invoke(core.clj:2330)
121-
at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__910.invoke(interruptible_eval.clj:138)
118+
at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__842.invoke(interruptible_eval.clj:138)
122119
at clojure.lang.AFn.run(AFn.java:24)
123-
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
124-
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
125-
at java.lang.Thread.run(Thread.java:680)
120+
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
121+
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
122+
at java.lang.Thread.run(Thread.java:722)
126123
Caused by: java.lang.RuntimeException: Failure updating row
127-
... 27 more
124+
at user$update_row.invoke(user.clj:22)
125+
... 24 more
128126
Caused by: java.sql.SQLException: Database failure
129-
... 27 more
127+
SELECT FOO, BAR, BAZ
128+
FROM GNIP
129+
failed with ABC123
130+
at user$jdbc_update.invoke(user.clj:6)
131+
at user$make_jdbc_update_worker$reify__214.do_work(user.clj:17)
132+
... 25 more
130133
```
131134

132135
... and here's the equivalent, via `write-exception`:
133136

134-
![](https://www.evernote.com/shard/s54/sh/ad94a14b-2107-4183-ab4a-3796a6225ea9/9295ec6d8acea581d2e0d7463026618c/deep/0/README.md----pretty----pretty------workspaces-annadale-pretty-.png)
137+
![](https://www.evernote.com/shard/s54/sh/9df8600b-adf2-4605-8298-48d78aa93dd7/e0fccbe84d3de74091ccc0fc3c70d411/deep/0/README.md----pretty----pretty------workspaces-annadale-pretty-.png)
135138

136139
`write-exception` navigates down the exception hierarchy; it only presents the stack trace for the deepest, or root, exception. It can navigate
137140
any property that returns a non-nil Throwable type, not just the rootCause property; this makes it properly expand older exceptions
@@ -144,3 +147,11 @@ or Java class and method, and the right columns presenting the file name and lin
144147

145148
The related function, `format-exception`, produces the same output, but returns it as a string.
146149

150+
# io.aviso.columns
151+
152+
The columnar namespace is what's used by the exceptions namespace to format the exceptions, properties, and stack
153+
traces.
154+
155+
The `format-columns` function is provided with a number of column definitions that describes the width and justification
156+
157+

0 commit comments

Comments
 (0)