in reply to RFC: Log::Painless

I think this is an improvement over the last. However, I really don't like the automatic importing of so many functions, particularly enter, leave and caught. I really think those should be optional. Consider the potential confusion of using this module next to Exception::Class which might be using it's own caught method! There's no real reason why you can't support variations like this:

use Log::Painless qw( :ALL ) { %opts }; use Log::Painless qw( :STD ) { %opts }; use Log::Painless qw( :NONE ) { %opts }; use Log::Painless qw( debug info ) { %opts };

It's fine to have your own import, but it would be great -- even if you automatically import a few functions -- to allow users to turn that off if they want.

Also, while a minor point, I'd rather see the Pod follow a more standard format, with the abstract describing the module, not the document, with the synopsis being just a short amount of code, and what you wrote in the synopsis being retitled to "Description" or "Usage".

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Replies are listed 'Best First'.
Re^2: RFC: Log::Painless
by radiantmatrix (Parson) on Mar 15, 2006 at 19:36 UTC

    However, I really don't like the automatic importing of so many functions, particularly enter, leave and caught.

    Actually, I agreed with you from the beginning. Those three functions can be excluded from import, or selectively imported:

    use Log::Painless { shortcuts => [] }; #or use Log::Painless { shortcuts => ['enter','leave'] };

    This is in the documentation, but I admit it doesn't jump out. I'd be happy to hear suggestions on how to make the document more clear.

    The end result is only really three functions are exported in a mandatory way: info, debug and trace. I will certainly give some thought to controlling the export of these -- my gut says that you must have these three available, but perhaps they could be aliased as the code author sees fit?

    I will take your POD suggestions and reorganize a bit before publishing to CPAN.

    Thanks for the response!

    <-radiant.matrix->
    A collection of thoughts and links from the minds of geeks
    The Code that can be seen is not the true Code
    I haven't found a problem yet that can't be solved by a well-placed trebuchet