Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force enable+trace exclusions #15

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
016ec55
added cljs-devtools https://github.com/binaryage/cljs-devtools support
stumitchell Jun 23, 2015
a6f4f28
removed logging to console
stumitchell Jun 23, 2015
7c76382
removed make-tracer
stumitchell Jun 24, 2015
e2366d5
indentation fixes for PR
stumitchell Jun 24, 2015
f916672
more whitespace
stumitchell Jun 24, 2015
251680e
changes to README.md
stumitchell Jun 24, 2015
e7d845a
Merge branch 'feature/cljs-devtools-support' of github.com:day8/clair…
stumitchell Jun 25, 2015
b98d6d8
non-cannonical branch
stumitchell Jun 25, 2015
34e92e3
moved to using goog.DEBUG for removal of tracing from production code
stumitchell Jul 7, 2015
235991d
fixed the readme for the goog.DEBUG changes
stumitchell Jul 7, 2015
c99493d
re-factored code to allow dead code elimination in closure compiler
stumitchell Jul 8, 2015
ace63cc
Merge branch 'goog.DEBUG' into clojars
stumitchell Jul 8, 2015
7ab7801
Merge branch 'develop' into clojars
stumitchell Jul 9, 2015
ba2a1af
made colours on tracer
stumitchell Jul 15, 2015
6cac5d7
Use closure-defines to determine if dev mode or not
danielcompton Feb 9, 2016
d3aacd7
Bump to 0.2.0
danielcompton Feb 9, 2016
cd36f74
Upgrade cljs dependencies
danielcompton Feb 9, 2016
bdf3cb6
Clean-up code formatting and improve readability
gnl Mar 31, 2017
4fcc15f
Add optional :enabled param to trace-forms to override devmode flag
gnl Mar 31, 2017
5278628
Add param documentation
gnl Mar 31, 2017
02e0d66
Add :exclude parameter to disable tracing for some ops
gnl Mar 31, 2017
7f43185
Tweak documentation
gnl Apr 1, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ is not necessarily tied to logging to the console or printing to the
screen. Since the trace values are just data the barrier to creativity
is low.

An additional tracer that works well with [cljs-devtools]
(https://github.com/binaryage/cljs-devtools) is included as
`clairvoyant.core/cljs-devtools-tracer`.


### Source code transformation

Expand All @@ -150,11 +154,15 @@ programmer to trace any form they wish rather than just the special forms.
#### Conditional tracing

If you want to remove tracing on production builds,
`clairvoyant.core/trace-forms` will not add tracing when the `:elide-asserts`
option (under `:compiler` options in your `project.clj` file) is set to true.
Therefore if you set this option in your prod builds you do not need to remove
`clairvoyant.core/trace-forms` from your source. This technique was taken from
the [reagent project](https://github.com/reagent-project/reagent)
`clairvoyant.core/trace-forms` will not add tracing when `js/goog.DEBUG`
is set to false this requires `:closure-defines {:goog.DEBUG false}`
option (under `:compiler` options in your `project.clj` file).
Therefore if you set this option in your prod builds you do not need to
remove `clairvoyant.core/trace-forms` from your source.

WARNING: to set this option you do need to have `:optimizations :simple`
or `optimizations :advanced` or else the value will not be set because
the closure compiler does not do the substitution.

## Trace data

Expand Down
48 changes: 24 additions & 24 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
(require '[clojure.java.shell])
(require '[clojure.string])
;(require '[clojure.java.shell])
;(require '[clojure.string])
;
;(def VERSION "0.1.0-SNAPSHOT"
; #_(do (-> (clojure.java.shell/sh "git" "describe" "--match" "v0.0")
; (:out)
; (.trim)
; (subs 1))))

(def VERSION
(do (-> (clojure.java.shell/sh "git" "describe" "--match" "v0.0")
(:out)
(.trim)
(subs 1))))

(defproject spellhouse/clairvoyant VERSION
(defproject org.clojars.stumitchell/clairvoyant "0.2.0"
:description "ClojureScript tracing library"
:url "http://github.com/spellhouse/clairvoyant"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}

:dependencies
[[org.clojure/clojure "1.6.0" :scope "provided"]
[org.clojure/clojurescript "0.0-2322" :scope "provided"]]
[[org.clojure/clojure "1.7.0" :scope "provided"]
[org.clojure/clojurescript "1.7.170" :scope "provided"]]

:clean-targets
:clean-targets
^{:protect false} ["dev-resources/public/out"
"resources/public/out"
"target"]

:cljsbuild
{:builds
:cljsbuild
{:builds
{:app {:source-paths ["src"]
:compiler
:compiler
{:output-to "dev-resources/public/clairvoyant.js"
:output-dir "dev-resources/public/out/"
:optimizations :none
Expand All @@ -36,10 +36,10 @@
"do cljsbuild clean, cljsbuild auto"
#"\s+")}

:release-tasks
:release-tasks
[["clean"]
["with-profiles"
"-dev,+release"
["with-profiles"
"-dev,+release"
"cljsbuild" "once"]
["jar"]]

Expand All @@ -55,18 +55,18 @@
:source-paths
["dev"]

:repl-options
{:nrepl-middleware
:repl-options
{:nrepl-middleware
[cemerick.piggieback/wrap-cljs-repl]}

:cljsbuild
{:builds {:app {:source-paths ["dev"]}}}}

:release
{:cljsbuild
:release
{:cljsbuild
{:jar true
:builds
{:app {:compiler
:builds
{:app {:compiler
{:output-to "resources/public/clairvoyant.js"
:output-dir "resources/public/out/"
:optimizations :advanced
Expand Down
Loading