Skip to content
Google Code Exporter edited this page Mar 13, 2015 · 1 revision
log4j zero-log
How to use?
val logger = LoggerFactory.getLogger(classOf[MyClass])

val (logger, formatter) = ZeroLoggerFactory.newLogger(this)
import formatter._
Overhead for determining if a logging statement should be logged or not
  • About 5 nanoseconds (Overhead from log4j), and...
  • 20 ~ 100 nanoseconds (Overhead for boxing / unboxing / varargs)
  • Exact 0 (When using compile-time configuration), or...
  • Less than 1 nanosecond (When using run-time configuration)
Support Scala Yes Yes
Support Java Yes No
Configuration file format properties or XML Scala
Static syntax checking for configuration No Yes (By scalac)
Support
scala.util.logging.Logged
No Yes
Support
scalac -Xelide-below
No Yes
Support run-time configuration Yes Yes
Support compile-time configuration No Yes
Does run-time configuration and compile-time configuration have same syntax? N/A Yes
Can configuration be debugged? No Yes
Number of appender implementations Many Few (Contribute yours!)
Number of formatter implementations Many Few (Contribute yours!)
Speed of formatting log messages Slow (Creating dozens of temporary objects with dozens of boxing / unboxing overhead) Very fast
Clone this wiki locally