Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
clj-stacktrace-clojure
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debian Clojure Maintainers
clj-stacktrace-clojure
Commits
4d266420
Commit
4d266420
authored
4 years ago
by
Utkarsh Gupta
Browse files
Options
Downloads
Patches
Plain Diff
New upstream version 0.2.7
parent
d04dccfa
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
LICENSE
+1
-1
1 addition, 1 deletion
LICENSE
README.md
+8
-22
8 additions, 22 deletions
README.md
project.clj
+2
-2
2 additions, 2 deletions
project.clj
src/clj_stacktrace/repl.clj
+10
-2
10 additions, 2 deletions
src/clj_stacktrace/repl.clj
with
22 additions
and
27 deletions
.gitignore
+
1
−
0
View file @
4d266420
...
...
@@ -3,3 +3,4 @@
/.lein-failures
/.lein-deps-sum
/target
/pom.xml.asc
This diff is collapsed.
Click to expand it.
LICENSE
+
1
−
1
View file @
4d266420
Copyright
(c)
2009 Mark McGranaghan
Copyright
©
2009
-2013
Mark McGranaghan
and contributors
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
...
...
This diff is collapsed.
Click to expand it.
README.md
+
8
−
22
View file @
4d266420
...
...
@@ -48,12 +48,11 @@ The library also offers an API for programatically 'parsing' exceptions. This AP
## Leiningen
If you use Leiningen, you can install clj-stacktrace on a per-user basis.
For Leiningen 2.x, add the following to
`~/.lein/profiles.clj`
:
If you use Leiningen, you can install clj-stacktrace on a user-wide
basis. Just add the following to
`~/.lein/profiles.clj`
:
```
clj
{
:user
{
:dependencies
[[
clj-stacktrace
"0.2.
5
"
]]
{
:user
{
:dependencies
[[
clj-stacktrace
"0.2.
7
"
]]
:injections
[(
let
[
orig
(
ns-resolve
(
doto
'clojure.stacktrace
require
)
'print-cause-trace
)
new
(
ns-resolve
(
doto
'clj-stacktrace.repl
require
)
...
...
@@ -61,26 +60,13 @@ For Leiningen 2.x, add the following to `~/.lein/profiles.clj`:
(
alter-var-root
orig
(
constantly
@
new
)))]}}
```
For Leiningen 1.x:
$ lein plugin install clj-stacktrace 0.2.5
Add this to your
`~/.lein/init.clj`
file:
```
clj
(
try
(
require
'leiningen.hooks.clj-stacktrace-test
)
(
def
settings
{
:repl-options
[
:init
(
require
'clj-stacktrace.repl
)
:caught
'clj-stacktrace.repl/pst+
]})
(
catch
java.io.FileNotFoundException
_
))
```
The hook will enable clj-stacktrace to be used across all the projects
you work on in clojure.test and other things that use the
clojure.stacktrace library. The
`:repl-options`
settings will cause
clj-stacktrace to be used in the repl and swank tasks.
The
`:injections`
clause replaces the built-in stack trace printing
with enhanced clj-stacktrace version; you can leave it out if you plan
on invoking clj-stacktrace functions directly or are using tools which
are already clj-stacktrace-aware.
## License
Copyright © 2009-201
2
Mark McGranaghan and contributors.
Copyright © 2009-201
3
Mark McGranaghan and contributors.
Released under an MIT license.
This diff is collapsed.
Click to expand it.
project.clj
+
2
−
2
View file @
4d266420
(
defproject
clj-stacktrace
"0.2.
6
"
(
defproject
clj-stacktrace
"0.2.
7
"
:description
"More readable stacktraces in Clojure programs."
:url
"http://github.com/mmcgrana/clj-stacktrace"
:url
"http
s
://github.com/mmcgrana/clj-stacktrace"
:license
{
:name
"MIT"
:url
"http://opensource.org/licenses/MIT"
}
:dependencies
[[
org.clojure/clojure
"1.4.0"
]])
This diff is collapsed.
Click to expand it.
src/clj_stacktrace/repl.clj
+
10
−
2
View file @
4d266420
...
...
@@ -33,6 +33,14 @@
(
re-find
#
"^clojure\."
(
:ns
elem
))
:magenta
:user-code
:green
)))
(
defn-
guarded-fence
[
coll
]
(
case
(
count
coll
)
0
0
1
(
first
coll
)
2
(
quot
(
+
(
first
coll
)
(
second
coll
))
2
)
(
utils/fence
coll
)))
(
defn
source-str
[
parsed
]
(
if
(
and
(
:file
parsed
)
(
:line
parsed
))
(
str
(
:file
parsed
)
":"
(
:line
parsed
))
...
...
@@ -65,7 +73,7 @@
(
defn
pst-elems-on
[
^
java.io.Writer
on
color?
parsed-elems
&
[
source-width
]]
(
let
[
print-width
(
+
6
(
or
source-width
(
utils/
fence
(
guarded-
fence
(
sort
(
map
#
(
.length
^
String
%
)
(
map
source-str
parsed-elems
))))))]
...
...
@@ -95,7 +103,7 @@
(
let
[
this-source-width
(
->>
(
:trace-elems
excp
)
(
map
(
comp
count
source-str
))
(
sort
)
(
utils/
fence
))]
(
guarded-
fence
))]
(
if
(
not-empty
(
->
excp
:cause
:trace-elems
))
(
max
this-source-width
(
find-source-width
(
:cause
excp
)))
this-source-width
)))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment