From: Tim Pease Date: 2011-03-26T00:23:51+09:00 Subject: Re: logging 1.5.0 On Mar 25, 2011, at 7:28 AM, Jon Forums wrote: >> logging version 1.5.0 > > Why might one prefer it over log4r? > Logging was created when log4r was abandoned. I tried contacting the original log4r developer many years ago and never received a response; therefore I started the logging project. As a side note, this led to an interesting discussion on how to handle abandoned projects on rubyforge. There is a "benchmark.rb" file in the test directory that compares the performance of logging, log4r, and the core ruby logger. It is a very simple benchmark, but logging outperforms the others in all the tests except for one (in that case the core ruby logger wins but just barely). > Any interesting optimizations similar to parameterized messages of > http://www.slf4j.org/faq.html#logging_performance > All those tricks apply. With the logging gem you can specify how general ruby objects are formatted: string, inspect, or yaml. When you log a general object then ... Logging.format_as(:inspect) ary = [1, 2, 3, 'four', 'five', 'six'] logger.info(ary) The array will be printed out in the form [1, 2, 3, "four", "five", "six"] > >> - colorization of log messages > > Does this work on Windows? May need to use > http://adoxa.110mb.com/ansicon/index.html > Colorization inserts ANSI terminal codes into the log messages. I have not tested it on windows with ansicon. However, if ansicon is truly compliant then it should work just fine. Good questions! I hope the answers were equally good. Blessings, TwP > Jon > > -- > Posted via http://www.ruby-forum.com/. >