Scala的日志框架:zero-log

jopen 12年前

zero-log是一个用于Scala程序,配置简单的快速日志框架。其目的是利用Scala的功能,让日志更快,更简单。

package com.yourDomain.yourProject  object Sample {    val (logger, formatter) = ZeroLoggerFactory.newLogger(this)    import formatter._      def main(args: Array[String]) {      logger.info("Logging in a Singleton.")      logger.fine("Hello,")      logger.warning("World!")      logger.finest {        _ ++= "Faster string formatting!\n" ++=        "args.length:" ++= args.length.toString      }      new Sample    }  }    class Sample {    import Sample.logger    import Sample.formatter._      logger.info("Logging in a class instance.")    logger.finer("Hello,")    logger.severe("World!", new Exception("With some Exception"))  }

项目主页:http://www.open-open.com/lib/view/home/1355634148151