There are lots of logging modules. They are either very complex and super featureful or are stripped down and address one problem. I originally wrote my module because I wanted something simple and flexible.
To get that flexibility I decided to use callbacks to handle formatting. That way if you want simple content wrapping you can have it, or if you want to process complex data structures, you can do that too.
I've used this module in several projects and it works nicely in both modes. Noting I've looked at seems to be quite as flexible. With other solutions I always wind up having to put a bunch of formatting code all over my programs.
$loglevel = 2; # should be set by getopt sub loglevel { my $data = shift; return $data->[1] <= $loglevel ? Dumper $data->[0] : ""; } # ... Insert some code here. $log->format(\&loglevel); $log->entry( [$some_ref, 1] ); $log->entry("We always log this!", 'standard' ); # Sticks a time and +date stamp in front of text.
TGI says moo
In reply to Re^2: Module Renaming Suggestions
by TGI
in thread Module Renaming Suggestions
by TGI
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |