mirror of https://github.com/status-im/timbre.git
Merge branch 'dev'
This commit is contained in:
commit
2248084653
|
@ -1,3 +1,10 @@
|
|||
## v3.1.1 / 2014 Feb 26
|
||||
|
||||
### Fixes
|
||||
|
||||
* Fix project.clj to prevent unnecessary downstream deps.
|
||||
|
||||
|
||||
## v3.1.0 / 2014 Feb 23
|
||||
|
||||
### New
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
**[API docs][]** | **[CHANGELOG][]** | [other Clojure libs][] | [Twitter][] | [contact/contributing](#contact--contributing) | current ([semantic][]) version:
|
||||
|
||||
```clojure
|
||||
[com.taoensso/timbre "3.1.0"] ; 3.x is a non-breaking upgrade - see CHANGELOG for details
|
||||
[com.taoensso/timbre "3.1.1"] ; 3.x is a non-breaking upgrade - see CHANGELOG for details
|
||||
```
|
||||
|
||||
Appender authors: please see [here](https://github.com/ptaoussanis/timbre/issues/41) about migrating Timbre 2.x appenders to 3.x's recommended style.
|
||||
|
@ -30,7 +30,7 @@ Logging with Java can be maddeningly, unnecessarily hard. Particularly if all yo
|
|||
Add the necessary dependency to your [Leiningen][] `project.clj` and use the supplied ns-import helper:
|
||||
|
||||
```clojure
|
||||
[com.taoensso/timbre "3.1.0"] ; project.clj
|
||||
[com.taoensso/timbre "3.1.1"] ; project.clj
|
||||
|
||||
(ns my-app (:require [taoensso.timbre :as timbre])) ; Your ns
|
||||
(timbre/refer-timbre) ; Provides useful Timbre aliases in this ns
|
||||
|
@ -259,7 +259,7 @@ The `profile` macro can now be used to log times for any wrapped forms:
|
|||
|
||||
You can also use the `defnp` macro to conveniently wrap whole fns.
|
||||
|
||||
It's important to note that Timbre profiling is fully **logging-level aware**: if the level is insufficient, you *won't pay for profiling*. Likewise, normal namespace filtering applies. (Performance characteristics for both checks are inherited from Timbre itself).
|
||||
It's important to note that Timbre profiling is fully **logging-level aware**: if the level is insufficient, you *won't pay for profiling* (there is a minimal dynamic-var deref cost). Likewise, normal namespace filtering applies. (Performance characteristics for both checks are inherited from Timbre itself).
|
||||
|
||||
And since `p` and `profile` **always return their body's result** regardless of whether profiling actually happens or not, it becomes feasible to use profiling more often as part of your normal workflow: just *leave profiling code in production as you do for logging code*.
|
||||
|
||||
|
@ -273,6 +273,8 @@ A simple **sampling profiler** is also available: `taoensso.timbre.profiling/sam
|
|||
|
||||
## Contact & contributing
|
||||
|
||||
`lein start-dev` to get a (headless) development repl that you can connect to with [Cider][] (emacs) or your IDE.
|
||||
|
||||
Please use the project's GitHub [issues page][] for project questions/comments/suggestions/whatever **(pull requests welcome!)**. Am very open to ideas if you have any!
|
||||
|
||||
Otherwise reach me (Peter Taoussanis) at [taoensso.com][] or on [Twitter][]. Cheers!
|
||||
|
@ -291,6 +293,7 @@ Copyright © 2012-2014 Peter Taoussanis. Distributed under the [Eclipse Publ
|
|||
[CDS]: <http://clojure-doc.org/>
|
||||
[ClojureWerkz]: <http://clojurewerkz.org/>
|
||||
[issues page]: <https://github.com/ptaoussanis/timbre/issues>
|
||||
[Cider]: <https://github.com/clojure-emacs/cider>
|
||||
[commit history]: <https://github.com/ptaoussanis/timbre/commits/master>
|
||||
[taoensso.com]: <https://www.taoensso.com>
|
||||
[Eclipse Public License]: <https://raw2.github.com/ptaoussanis/timbre/master/LICENSE>
|
||||
|
|
38
project.clj
38
project.clj
|
@ -1,4 +1,4 @@
|
|||
(defproject com.taoensso/timbre "3.1.0"
|
||||
(defproject com.taoensso/timbre "3.1.1"
|
||||
:author "Peter Taoussanis <https://www.taoensso.com>"
|
||||
:description "Clojure logging & profiling library"
|
||||
:url "https://github.com/ptaoussanis/timbre"
|
||||
|
@ -11,40 +11,42 @@
|
|||
*assert* true}
|
||||
:dependencies
|
||||
[[org.clojure/clojure "1.4.0"]
|
||||
[io.aviso/pretty "0.1.8"]
|
||||
[com.taoensso/encore "0.8.0"]]
|
||||
[com.taoensso/encore "0.9.2"]
|
||||
[io.aviso/pretty "0.1.8"]]
|
||||
|
||||
:test-paths ["test" "src"]
|
||||
:profiles
|
||||
{:build {:hooks ^:replace []} ; Workaround to avoid :dev hooks during deploy
|
||||
{;; :default [:base :system :user :provided :dev]
|
||||
:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
|
||||
:1.6 {:dependencies [[org.clojure/clojure "1.6.0-beta1"]]}
|
||||
:test {:dependencies [[expectations "1.4.56"]
|
||||
[reiddraper/simple-check "0.5.6"]
|
||||
[org.xerial.snappy/snappy-java "1.1.1-M1"]
|
||||
[org.clojure/data.fressian "0.2.0"]]
|
||||
[com.taoensso/nippy "2.5.2"]
|
||||
[com.taoensso/carmine "2.4.6"]
|
||||
[com.draines/postal "1.11.1"]
|
||||
[org.clojure/tools.logging "0.2.6"]]
|
||||
:plugins [[lein-expectations "0.0.8"]
|
||||
[lein-autoexpect "1.2.2"]]}
|
||||
:dev* [:dev {:jvm-opts ^:replace ["-server"]
|
||||
;; :hooks [cljx.hooks leiningen.cljsbuild] ; cljx
|
||||
}]
|
||||
:dev
|
||||
[:1.6 :test
|
||||
{:jvm-opts ^:replace ["-server"]
|
||||
:hooks []
|
||||
:dependencies [[com.draines/postal "1.11.1"]
|
||||
[org.clojure/tools.logging "0.2.6"]
|
||||
[com.taoensso/nippy "2.5.2"]
|
||||
[com.taoensso/carmine "2.4.6"]]
|
||||
{:dependencies []
|
||||
:plugins []}]}
|
||||
|
||||
:plugins [[lein-ancient "0.5.4"]
|
||||
:plugins [[lein-ancient "0.5.4"]
|
||||
[codox "0.6.7"]]
|
||||
|
||||
;; :codox {:sources ["target/classes"]} ; For use with cljx
|
||||
;; :codox {:sources ["target/classes"]} ; cljx
|
||||
:aliases
|
||||
{"test-all" ["with-profile" "+test:+1.5,+test:+1.6,+test" "expectations"]
|
||||
{"test-all" ["with-profile" "default:+1.5:+1.6" "expectations"]
|
||||
;; "test-all" ["with-profile" "default:+1.6" "expectations"]
|
||||
"test-auto" ["with-profile" "+test" "autoexpect"]
|
||||
"start-dev" ["with-profile" "+dev" "repl" ":headless"]
|
||||
"codox" ["with-profile" "+test" "doc"]
|
||||
"deploy-lib" ["with-profile" "+dev,+build" "do" "deploy" "clojars," "install"]}
|
||||
;; "build-once" ["do" "cljx" "once," "cljsbuild" "once"] ; cljx
|
||||
;; "deploy-lib" ["do" "build-once," "deploy" "clojars," "install"] ; cljx
|
||||
"deploy-lib" ["do" "deploy" "clojars," "install"]
|
||||
"start-dev" ["with-profile" "+dev*" "repl" ":headless"]}
|
||||
|
||||
:repositories
|
||||
{"sonatype"
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
(ns taoensso.timbre.profiling
|
||||
"Logging profiler for Timbre, adapted from clojure.contrib.profile."
|
||||
{:author "Peter Taoussanis"}
|
||||
(:require [clojure.tools.macro :as macro]
|
||||
[taoensso.encore :as encore]
|
||||
[taoensso.timbre :as timbre]))
|
||||
(:require [taoensso.encore :as encore]
|
||||
[taoensso.timbre :as timbre]))
|
||||
|
||||
(defmacro fq-keyword "Returns namespaced keyword for given id."
|
||||
[id]
|
||||
|
@ -30,6 +29,12 @@
|
|||
|
||||
(defmacro p [id & body] `(pspy ~id ~@body)) ; Alias
|
||||
|
||||
(comment
|
||||
(time (dotimes [_ 1000000])) ; ~20ms
|
||||
;; Note that times are ~= for `pspy` as a pure macro and as a `pspy*` fn caller:
|
||||
(time (dotimes [_ 1000000] (pspy :foo))) ; ~300ms
|
||||
)
|
||||
|
||||
(declare pdata-stats format-pdata)
|
||||
|
||||
(defmacro with-pdata [level & body]
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
(timbre/refer-timbre)
|
||||
|
||||
(comment (test/run-tests '[taoensso.timbre.tests.main]))
|
||||
|
||||
(defn- before-run {:expectations-options :before-run} [])
|
||||
(defn- after-run {:expectations-options :after-run} [])
|
||||
|
||||
|
|
Loading…
Reference in New Issue