<commit_before>(ns org.altlaw.util.log
  (:import (org.apache.commons.logging Log LogFactory)
           (org.altlaw.util.logging
            JavaLoggingToCommonLoggingRedirector)))

(JavaLoggingToCommonLoggingRedirector/activate)

;; Returns the logger named after the given namespace.  Caches
;; loggers.
(def get-ns-log
     (memoize (fn [ns] (LogFactory/getLog (str (ns-name ns))))))

(defmacro trace [label arg]
  `(let [value# ~arg
         log# (get-ns-log *ns*)]
     (when (. log# isTraceEnabled)
       (. log# (trace (str ~label ":" (pr-str value#)))))
     value#))

(defmacro debug [& args]
  `(let [log# (get-ns-log *ns*)]
     (when (. log# isDebugEnabled)
       (. log# (debug (str ~@args))))))

(defmacro info [& args]
  `(let [log# (get-ns-log *ns*)]
     (when (. log# isInfoEnabled)
       (. log# (info (str ~@args))))))

(defmacro warn [& args]
  `(let [log# (get-ns-log *ns*)]
     (when (. log# isWarnEnabled)
       (. log# (warn (str ~@args))))))

(defmacro error [& args]
  `(let [log# (get-ns-log *ns*)]
     (when (. log# isErrorEnabled)
       (. log# (error (str ~@args))))))

(defmacro fatal [& args]
  `(let [log# (get-ns-log *ns*)]
     (when (. log# isFatalEnabled)
       (. log# (fatal (str ~@args))))))
<commit_msg>util/log.clj: modified to use lexical namespace<commit_after>(ns org.altlaw.util.log
  (:import (org.apache.commons.logging Log LogFactory)
           (org.altlaw.util.logging
            JavaLoggingToCommonLoggingRedirector)))

(JavaLoggingToCommonLoggingRedirector/activate)

(defmacro trace [label arg]
  `(let [value# ~arg
         log# (. LogFactory getLog ~(str (ns-name *ns*)))]
     (when (. log# isTraceEnabled)
       (. log# (trace (str ~label ":" (pr-str value#)))))
     value#))

(defmacro debug [& args]
  `(let [log# (. LogFactory getLog ~(str (ns-name *ns*)))]
     (when (. log# isDebugEnabled)
       (. log# (debug (str ~@args))))))

(defmacro info [& args]
  `(let [log# (. LogFactory getLog ~(str (ns-name *ns*)))]
     (when (. log# isInfoEnabled)
       (. log# (info (str ~@args))))))

(defmacro warn [& args]
  `(let [log# (. LogFactory getLog ~(str (ns-name *ns*)))]
     (when (. log# isWarnEnabled)
       (. log# (warn (str ~@args))))))

(defmacro error [& args]
  `(let [log# (. LogFactory getLog ~(str (ns-name *ns*)))]
     (when (. log# isErrorEnabled)
       (. log# (error (str ~@args))))))

(defmacro fatal [& args]
  `(let [log# (. LogFactory getLog ~(str (ns-name *ns*)))]
     (when (. log# isFatalEnabled)
       (. log# (fatal (str ~@args))))))

{'fraction_non_alphanumeric': 0.20346320346320346, 'fraction_numerical': 0.0, 'mean_word_length': 3.034920634920635, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4483589', 'n_tokens_mistral': 974, 'n_tokens_neox': 926, 'n_words': 240}