Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make ns-filter runtime again

The compile-time filtering can trip up in surprising ways, and doesn't
work with tools.logging.

This commit switches back to a runtime ns filter which is a teeny, tiny
bit slower - but always predictable.
  • Loading branch information...
commit a6ecb2c1e603548f4bfd01526b5422d8be5187a4 1 parent a1bf286
@ptaoussanis authored
View
3  CHANGELOG.md
@@ -1,5 +1,4 @@
-## v2.5.0 → v2.6.0
- * Perf: make ns filtering a compile-time check.
+## v2.5.0 → v2.6.1
* Perf: add support for a compile-time logging level environment variable (`TIMBRE_LOG_LEVEL`). See `timbre/compile-time-level` docstring for details.
View
4 README.md
@@ -1,7 +1,7 @@
**[API docs](http://ptaoussanis.github.io/timbre/)** | **[CHANGELOG](https://github.com/ptaoussanis/timbre/blob/master/CHANGELOG.md)** | [contact & contributing](#contact--contributing) | [other Clojure libs](https://www.taoensso.com/clojure-libraries) | [Twitter](https://twitter.com/#!/ptaoussanis) | current [semantic](http://semver.org/) version:
```clojure
-[com.taoensso/timbre "2.6.0"] ; See CHANGELOG for breaking changes since 1.x
+[com.taoensso/timbre "2.6.1"] ; See CHANGELOG for breaking changes since 1.x
```
# Timbre, a (sane) Clojure logging & profiling library
@@ -27,7 +27,7 @@ Logging with Java can be maddeningly, unnecessarily hard. Particularly if all yo
Add the necessary dependency to your [Leiningen](http://leiningen.org/) `project.clj` and `require` the library in your ns:
```clojure
-[com.taoensso/timbre "2.6.0"] ; project.clj
+[com.taoensso/timbre "2.6.1"] ; project.clj
(ns my-app (:require [taoensso.timbre :as timbre
:refer (trace debug info warn error fatal spy with-log-level)])) ; ns
```
View
2  project.clj
@@ -1,4 +1,4 @@
-(defproject com.taoensso/timbre "2.6.0"
+(defproject com.taoensso/timbre "2.6.1"
:description "Clojure logging & profiling library"
:url "https://github.com/ptaoussanis/timbre"
:license {:name "Eclipse Public License"
View
14 src/taoensso/timbre.clj
@@ -334,13 +334,13 @@
(defmacro logging-enabled?
"Returns true iff current logging level is sufficient and current namespace
- unfiltered. The namespace test is compile-time, the logging-level test
- compile-time iff a compile-time logging level was specified."
- [level & body]
- (when (@ns-filter-cache *ns*)
- (if compile-time-level
- (sufficient-level? level)
- `(sufficient-level? ~level))))
+ unfiltered. The namespace test is runtime, the logging-level test compile-time
+ iff a compile-time logging level was specified."
+ [level]
+ (if compile-time-level
+ (when (sufficient-level? level)
+ `(@ns-filter-cache *ns*))
+ `(and (sufficient-level? ~level) (@ns-filter-cache *ns*))))
(comment
(def compile-time-level :info)
Please sign in to comment.
Something went wrong with that request. Please try again.