mirror of
https://github.com/status-im/timbre.git
synced 2025-02-17 22:27:10 +00:00
Misc hk
This commit is contained in:
parent
36785d6871
commit
46376869be
@ -53,7 +53,7 @@
|
|||||||
#+clj (enc/defalias core-appenders/println-appender)
|
#+clj (enc/defalias core-appenders/println-appender)
|
||||||
#+clj (enc/defalias core-appenders/spit-appender)
|
#+clj (enc/defalias core-appenders/spit-appender)
|
||||||
#+cljs (def println-appender core-appenders/println-appender)
|
#+cljs (def println-appender core-appenders/println-appender)
|
||||||
#+cljs (def console-?appender core-appenders/console-?appender)
|
#+cljs (def console-appender core-appenders/console-appender)
|
||||||
|
|
||||||
(def example-config
|
(def example-config
|
||||||
"Example (+default) Timbre v4 config map.
|
"Example (+default) Timbre v4 config map.
|
||||||
@ -120,7 +120,7 @@
|
|||||||
|
|
||||||
#+cljs
|
#+cljs
|
||||||
{;; :println (println-appender {})
|
{;; :println (println-appender {})
|
||||||
:console (console-?appender {})}})
|
:console (console-appender {})}})
|
||||||
|
|
||||||
(comment
|
(comment
|
||||||
(set-config! example-config)
|
(set-config! example-config)
|
||||||
@ -678,6 +678,7 @@
|
|||||||
|
|
||||||
;;;; Deprecated
|
;;;; Deprecated
|
||||||
|
|
||||||
|
#+cljs (def console-?appender core-appenders/console-appender)
|
||||||
(defn logging-enabled? [level compile-time-ns] (log? level (str compile-time-ns)))
|
(defn logging-enabled? [level compile-time-ns] (log? level (str compile-time-ns)))
|
||||||
(defn str-println [& xs] (str-join xs))
|
(defn str-println [& xs] (str-join xs))
|
||||||
(defmacro with-log-level [level & body] `(with-level ~level ~@body))
|
(defmacro with-log-level [level & body] `(with-level ~level ~@body))
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
(ns taoensso.timbre.appenders.core
|
(ns taoensso.timbre.appenders.core
|
||||||
"Core Timbre appenders without any special dependency requirements. These can
|
"Core Timbre appenders without any special dependency requirements.
|
||||||
be aliased into the main Timbre ns for convenience."
|
These can be aliased into the main Timbre ns for convenience."
|
||||||
{:author "Peter Taoussanis"}
|
{:author "Peter Taoussanis"}
|
||||||
#+clj
|
#+clj
|
||||||
(:require
|
(:require
|
||||||
[clojure.string :as str]
|
[clojure.string :as str]
|
||||||
[taoensso.encore :as enc :refer (have have? qb)])
|
[taoensso.encore :as enc :refer (have have? qb)])
|
||||||
|
|
||||||
#+cljs
|
#+cljs
|
||||||
(:require
|
(:require
|
||||||
[clojure.string :as str]
|
[clojure.string :as str]
|
||||||
[taoensso.encore :as enc :refer () :refer-macros (have have?)]))
|
[taoensso.encore :as enc :refer-macros (have have?)]))
|
||||||
|
|
||||||
;;;; TODO
|
;; TODO Add a simple official rolling spit appender?
|
||||||
;; * Simple official rolling spit appender?
|
|
||||||
|
|
||||||
;;;; Example appender
|
;;;; Example appender ---> (COPY THIS TO MAKE YOUR OWN APPENDER) <---
|
||||||
|
|
||||||
#_
|
#_
|
||||||
(defn example-appender
|
(defn example-appender
|
||||||
@ -134,7 +133,7 @@
|
|||||||
;;;; js/console appender (cljs only)
|
;;;; js/console appender (cljs only)
|
||||||
|
|
||||||
#+cljs
|
#+cljs
|
||||||
(defn console-?appender
|
(defn console-appender
|
||||||
"Returns a simple js/console appender for ClojureScript.
|
"Returns a simple js/console appender for ClojureScript.
|
||||||
|
|
||||||
For accurate line numbers in Chrome, add these Blackbox[1] patterns:
|
For accurate line numbers in Chrome, add these Blackbox[1] patterns:
|
||||||
@ -145,8 +144,8 @@
|
|||||||
[1] Ref. https://goo.gl/ZejSvR"
|
[1] Ref. https://goo.gl/ZejSvR"
|
||||||
|
|
||||||
;; TODO Any way of using something like `Function.prototype.bind`
|
;; TODO Any way of using something like `Function.prototype.bind`
|
||||||
;; (Ref. https://goo.gl/JQKY2V) to get accurate line numbers in all browsers
|
;; (Ref. https://goo.gl/IZzkQB) to get accurate line numbers in all
|
||||||
;; w/o the need for Blackboxing?
|
;; browsers w/o the need for Blackboxing?
|
||||||
|
|
||||||
[& [{:keys [raw-output?]} ; Undocumented (experimental)
|
[& [{:keys [raw-output?]} ; Undocumented (experimental)
|
||||||
]]
|
]]
|
||||||
@ -183,4 +182,8 @@
|
|||||||
|
|
||||||
(fn [data] nil))})
|
(fn [data] nil))})
|
||||||
|
|
||||||
(comment (console-?appender))
|
(comment (console-appender))
|
||||||
|
|
||||||
|
;;;; Deprecated
|
||||||
|
|
||||||
|
#+cljs (def console-?appender "DEPRECATED" console-appender)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user