Skip to content

Releases: clj-commons/pretty

Improved Documentation

27 May 18:13
Compare
Choose a tag to compare
Pre-release

This release primarily improves the function docstrings, leveraging the latest features of Codox.

One minor change was to the standard stack frame filter, which now omits stack frames from the sun.reflect package (or sub-packages).

No issues were fixed in this release.

Stack Frame Filtering

14 May 20:57
Compare
Choose a tag to compare
Stack Frame Filtering Pre-release
Pre-release

It is now possible to specify a filter for the stack frames in the exception report; frames can be hidden (in which case they are not displayed at all), or omitted. Consecutive omitted frames are reduced down to a single ellipsis. This can remove significant clutter from the exception report, making it that much easier to identify the true cause.

For write-exception and format-exception there is no default filter.

For exceptions added via io.aviso.repl/install-pretty-exceptions, the filtering omits frames from the clojure.lang package, and terminates output when the frames for the REPL are reached.

For comparison, this is the filtered output produced via clojure.repl/pst:

java.lang.RuntimeException: Request handling exception
java.lang.RuntimeException: Failure updating row
     java.sql.SQLException: Database failure
                            SELECT FOO, BAR, BAZ
                            FROM GNIP
                            failed with ABC123
     SQLState: "ABC"
    errorCode: 123
                          user/jdbc-update                          user.clj:    7
user/make-jdbc-update-worker/reify/do-work                          user.clj:   18
                           user/update-row                          user.clj:   23
                       user/make-exception                          user.clj:   31
                             user/eval1399  form-init1706920952124877859.clj:    1
                                       ...                                        
                         clojure.core/eval                          core.clj: 2927

This is the full output from write-exception:

java.lang.RuntimeException: Request handling exception
java.lang.RuntimeException: Failure updating row
     java.sql.SQLException: Database failure
                            SELECT FOO, BAR, BAZ
                            FROM GNIP
                            failed with ABC123
     SQLState: "ABC"
    errorCode: 123
                                                          user/jdbc-update                          user.clj:    7
                                user/make-jdbc-update-worker/reify/do-work                          user.clj:   18
                                                           user/update-row                          user.clj:   23
                                                       user/make-exception                          user.clj:   31
                                                             user/eval1399  form-init1706920952124877859.clj:    1
                                                clojure.lang.Compiler.eval                     Compiler.java: 6703
                                                clojure.lang.Compiler.eval                     Compiler.java: 6666
                                                         clojure.core/eval                          core.clj: 2927
                                      clojure.main/repl/read-eval-print/fn                          main.clj:  239
                                         clojure.main/repl/read-eval-print                          main.clj:  239
                                                      clojure.main/repl/fn                          main.clj:  257
                                                         clojure.main/repl                          main.clj:  257
                                                clojure.lang.RestFn.invoke                       RestFn.java: 1096
             clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn            interruptible_eval.clj:   56
                                            clojure.lang.AFn.applyToHelper                          AFn.java:  152
                                                  clojure.lang.AFn.applyTo                          AFn.java:  144
                                                        clojure.core/apply                          core.clj:  624
                                               clojure.core/with-bindings*                          core.clj: 1862
                                                clojure.lang.RestFn.invoke                       RestFn.java:  425
                clojure.tools.nrepl.middleware.interruptible-eval/evaluate            interruptible_eval.clj:   41
clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn            interruptible_eval.clj:  171
                                                      clojure.core/comp/fn                          core.clj: 2402
             clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn            interruptible_eval.clj:  138
                                                      clojure.lang.AFn.run                          AFn.java:   22
                         java.util.concurrent.ThreadPoolExecutor.runWorker           ThreadPoolExecutor.java: 1145
                        java.util.concurrent.ThreadPoolExecutor$Worker.run           ThreadPoolExecutor.java:  615
                                                      java.lang.Thread.run                       Thread.java:  724

Note: The signatures of the format-exception and write-exception functions have changed; the optional last parameter is now a simple map, rather than a variable number of key/value pairs.

Closed Issues

REPL improvements

07 Mar 23:08
Compare
Choose a tag to compare
REPL improvements Pre-release
Pre-release

This release addresses some minor performance issues related to using the REPL.

Closed Issues

Pretty Tests

26 Feb 14:43
Compare
Choose a tag to compare
Pretty Tests Pre-release
Pre-release

The main change in this release is that the functions used by clojure.test to output exceptions are now hooked to use pretty to format the exceptions.

In addition, you now have greater control over exception output: whether properties are displayed, and an optional limit on the number of stack frames listed.

Closed Issues

REPL support

20 Dec 00:41
Compare
Choose a tag to compare
REPL support Pre-release
Pre-release

This quick release adds new namespaces for automatically enabling pretty exception reporting when using nREPL via Leiningen. It's easy to use even if you aren't using Leiningen.

Closed issues in 0.1.8

ASCII output for write-binary

19 Dec 19:58
Compare
Choose a tag to compare
Pre-release

Added new abilities to output binary data with a companion ASCII column, and control the number of bytes per line.

Closed Issues in 0.1.7

Let's do columns!

14 Nov 19:09
Compare
Choose a tag to compare
Let's do columns! Pre-release
Pre-release

This release breaks out the columns support (used by the exception report) into its own namespace.

The ANSI namespace adds adds support for inverse output, as well as strip-ansi to remove the ANSI codes from a string.

The exception report has been re-formatted to take up less horizontal space.

Minor improvements

08 Nov 18:09
Compare
Choose a tag to compare
Minor improvements Pre-release
Pre-release

This version does a better job of indenting multi-line error messages for exceptions.

It demangles the names of reified classes (using the same logic as Clojure function names).

Error properties are now indented much less, allowing more room for the values.

Pretty printing

05 Nov 23:01
Compare
Choose a tag to compare
Pretty printing Pre-release
Pre-release

Along with a number of documentation cleanups and some refactoring of the Writer protocol, this release adds pretty-printing of the properties associated with each exception.

Minor improvements

28 Oct 18:31
Compare
Choose a tag to compare
Minor improvements Pre-release
Pre-release

This release primarily refactors out write- methods from the original format- methods. This makes it easier to directly write formatted data to a java.lang.Writer or java.lang.StringBuilder.