Back

may-log? (clj)

(source)

function

(may-log? level) (may-log? level ?ns-str) (may-log? level ?ns-str ?config) (may-log? default-min-level level ?ns-str ?config)
Implementation detail. Returns true iff level and ns are runtime unfiltered.

Examples

fulcrologic/fulcro-rad
(ns com.fulcrologic.rad.errors
  "Support for consistent error reporting across all RAD projects/plugins. These errors report during development, but
  become no-ops in release builds that have zero overhead."
  #?(:cljs (:require-macros [com.fulcrologic.rad.errors]))
  (:require
    [clojure.spec.alpha :as s]
    [taoensso.encore :as enc]
    [taoensso.timbre :as log]))

(defmacro warn-once!
  [& args] `(when (log/may-log? :info)
              (when-not (contains? @prior-warnings [~@args])
                (vswap! prior-warnings conj [~@args])
                (log/warn ~@args))))