PrePAN

Sign in to PrePAN

Profile

User's Modules

Logging::Trivial The simplest useful logging module

EDIT

Log4Perl's easy-mode is the best solution to this problem.


I wanted to be able to write

INFO "blah"; WARN "foo";

to output:

INFO: "blah" WARN: "foo"

and so on, and have logging to a file, and found the following modules:

Name            | Why I didn't want to use it            
--------------- | -------------------------------------- 
Log::Simplest | Ugly interface & not enough levels     
Log::Trivial  | OO interface is overkill for this task 
Log::Log4Perl | Too complicated!                       
Carp          | Not enough levels                      

So I wrote my own :)

The problems are:

  • The namespace is cluttered and I don't think my name is that useful
  • Exporting 5 functions by default is quite a few, but you wouldn't use this module if you didn't want them
  • I know that this goes against the 'don't reinvent the wheel' doctrine.

alexander-brett@github 5 comments