Merge branch 'dev'

This commit is contained in:
Peter Taoussanis 2014-03-11 14:42:57 +07:00
commit 80ce113a98
5 changed files with 27 additions and 28 deletions

View File

@ -1,6 +1,6 @@
## v3.1.2 / 2014 Mar 9
## v3.1.3 / 2014 Mar 11
* FIX: Carmine appender unfreezable support for Carmine v3+.
* FIX: profiling id namespacing.
## v3.1.1 / 2014 Feb 26

View File

@ -1,7 +1,7 @@
**[API docs][]** | **[CHANGELOG][]** | [other Clojure libs][] | [Twitter][] | [contact/contributing](#contact--contributing) | current ([semantic][]) version:
```clojure
[com.taoensso/timbre "3.1.2"] ; 3.x is a non-breaking upgrade - see CHANGELOG for details
[com.taoensso/timbre "3.1.3"] ; 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.2"] ; project.clj
[com.taoensso/timbre "3.1.3"] ; project.clj
(ns my-app (:require [taoensso.timbre :as timbre])) ; Your ns
(timbre/refer-timbre) ; Provides useful Timbre aliases in this ns

View File

@ -1,4 +1,4 @@
(defproject com.taoensso/timbre "3.1.2"
(defproject com.taoensso/timbre "3.1.3"
:author "Peter Taoussanis <https://www.taoensso.com>"
:description "Clojure logging & profiling library"
:url "https://github.com/ptaoussanis/timbre"

View File

@ -59,30 +59,29 @@
nmax-entries (nentries-by-level level)]
(when (> nmax-entries 0)
(binding [nippy/*final-freeze-fallback* nippy/freeze-fallback-as-str]
(car/wcar (or conn-opts (:conn opts)) ; :conn is Deprecated
(car/wcar (or conn-opts (:conn opts)) ; :conn is Deprecated
(binding [nippy/*final-freeze-fallback* nippy/freeze-fallback-as-str]
(car/hset k-hash entry-hash entry))
(car/zadd k-zset udt entry-hash)
(car/hset k-hash entry-hash entry)
(car/zadd k-zset udt entry-hash)
(when (< (rand) 0.01) ; Occasionally GC
;; This is necessary since we're doing zset->entry-hash->entry
;; rather than zset->entry. We want the former for the control
;; it gives us over what should constitute a 'unique' entry.
(car/lua
"-- -ive idx used to prune from the right (lowest score first)
local max_idx = (0 - (tonumber(_:nmax-entries)) - 1)
local entries_to_prune =
redis.call('zrange', _:k-zset, 0, max_idx)
redis.call('zremrangebyrank', _:k-zset, 0, max_idx) -- Prune zset
(when (< (rand) 0.01) ; Occasionally GC
;; This is necessary since we're doing zset->entry-hash->entry
;; rather than zset->entry. We want the former for the control
;; it gives us over what should constitute a 'unique' entry.
(car/lua
"-- -ive idx used to prune from the right (lowest score first)
local max_idx = (0 - (tonumber(_:nmax-entries)) - 1)
local entries_to_prune =
redis.call('zrange', _:k-zset, 0, max_idx)
redis.call('zremrangebyrank', _:k-zset, 0, max_idx) -- Prune zset
for i,entry in pairs(entries_to_prune) do
redis.call('hdel', _:k-hash, entry) -- Prune hash
end
return nil"
{:k-zset k-zset
:k-hash k-hash}
{:nmax-entries nmax-entries})))))))})))
for i,entry in pairs(entries_to_prune) do
redis.call('hdel', _:k-hash, entry) -- Prune hash
end
return nil"
{:k-zset k-zset
:k-hash k-hash}
{:nmax-entries nmax-entries}))))))})))
;;;; Query utils

View File

@ -7,7 +7,7 @@
(defmacro fq-keyword "Returns namespaced keyword for given id."
[id]
`(if (and (keyword? ~id) (namespace ~id)) ~id
(keyword (str ~*ns*) (name ~id))))
(keyword (str *ns*) (name ~id))))
(comment (map #(fq-keyword %) ["foo" :foo :foo/bar]))