• (log level message)
  • (log level message throwable)
  • (log level message throwable log-ns)
Logs a message, either directly or via an agent. Also see the level-specific
convenience macros.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/logging.clj:208 top

(defmacro log
  "Logs a message, either directly or via an agent. Also see the level-specific
  convenience macros."
  ([level message]
    `(log ~level ~message nil))
  ([level message throwable]
    `(log ~level ~message ~throwable ~(str *ns*)))
  ([level message throwable log-ns]
    `(let [log# (impl-get-log ~log-ns)]
      (if (impl-enabled? log# ~level)
        (if (and @*allow-direct-logging*
                 (not (clojure.lang.LockingTransaction/isRunning)))
          (impl-write! log# ~level ~message ~throwable)
          (send-off *logging-agent*
            (fn [_# l# v# m# t#] (impl-write! l# v# m# t#))
            log# ~level ~message ~throwable))))))
Vars in clojure.contrib.logging/log: *ns* defmacro str and apply concat deref fn let list not send-off seq vector
Used in 0 other vars

Comments top

No comments for log. Log in to add a comment.