From: Mike S. <m...@pe...> - 2007-03-22 20:11:12
|
On Thu, 22 Mar 2007, Livshits, Alex, GCM wrote: > Please let me know your opinion of the principal advantages of > Log4perl comparing to Log::ErrLogger ( http://backpan.perl.org/authors/id/W/WO/WORENKD/Log-ErrLogger- > > 1.5.readme ) ... from our FAQ: Why use Log::Log4perl instead of any other logging module on CPAN? That's a good question. There's dozens of logging modules on CPAN. When it comes to logging, people typically think: ``Aha. Writing out debug and error messages. Debug is lower than error. Easy. I'm gonna write my own.'' Writing a logging module is like a rite of passage for every Perl programmer, just like writing your own templating system. Of course, after getting the basics right, features need to be added. You'd like to write a timestamp with every message. Then timestamps with microseconds. Then messages need to be written to both the screen and a log file. And, as your application grows in size you might wonder: Why doesn't my logging system scale along with it? You would like to switch on logging in selected parts of the application, and not all across the board, because this kills performance. This is when people turn to Log::Log4perl, because it handles all of that. Avoid this costly switch. Use Log::Log4perl right from the start. Log::Log4perl's :easy mode supports easy logging in simple scripts: use Log::Log4perl qw(:easy); Log::Log4perl->easy_init($DEBUG); DEBUG "A low-level message"; ERROR "Won't make it until level gets increased to ERROR"; And when your application inevitably grows, your logging system grows with it without you having to change any code. Please, don't re-invent logging. Log::Log4perl is here, it's easy to use, it scales, and covers many areas you haven't thought of yet, but will enter soon. http://log4perl.sourceforge.net/d/Log/Log4perl/FAQ.html#eaf02 -- Mike Mike Schilli m...@pe... |