Fork me on GitHub

Hello. Question about In get-logger implementation we call (str logger-ns)

(reify LoggerFactory
          (name [_#]
          (get-logger [_# logger-ns#]
            (org.slf4j.LoggerFactory/getLogger ^String (str logger-ns#))))
This str is called every time from enabled?. As result disabled levels like (log/trace ...) utilise ~30 ms just in testing for enabled?. Can this code be improved so that disabled log levels cost as little as possible?


Well, probably I'm wrong and slow part is org.slf4j.LoggerFactory/getLogger is the slowest part...


It would be great to avoid repetitive computations for every log statement in single namespace...


need a fuller problem reproduction


@serioga Since the Clojure code in tools.logging is just delegating to one of a number of Java libraries, and it is inside those Java libraries that the decision about disabled log levels is done, based on their configuration, I'm not sure how much "delegation overhead" you're going to be able to get rid of. I'd say that if you really care about logging performance and the overhead of disabled log levels, you should either not put logging calls in performance-critical code or not use tools.logging and do Java interop directly, or both.