Skip to content

Instantly share code, notes, and snippets.

@elliot42
Created February 19, 2014 01:03
Show Gist options
  • Save elliot42/9084157 to your computer and use it in GitHub Desktop.
Save elliot42/9084157 to your computer and use it in GitHub Desktop.
(defn logging-seq
"Seq that logs its counter every N items"
([title n s]
(logging-seq title n s 0))
([title n s ix]
(when-let [head (first s)]
(when (= 0 (mod ix n))
(timbre/info title ix))
(cons head (lazy-seq (logging-seq title n (rest s) (inc ix)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment