Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I'm not sure why, but I think the API lacks a certain elegance.

    Personally I'd have done the name'ology differently (although tbh I'm not sure what I'd have used instead).
    • Upon re-reading I think two things I'm not a fan of are the "Any" suffix, and the use of package-named class-level storage.

      What if I want to make an logger for a single object...
      • As far as the package-named class-level storage: the "use Log::Any qw($log)" syntax is just a convenient shorthand that, imho, will be good enough for some modules. If you are uncomfortable with this, you can use the more standard syntax

                my $log = Log::Any->get_logger(category => '...');

        and you would use this to create a lexically scoped logger or a logger contained in an object.

        As far as the "Any" name - I agree, it isn't ideal, but I haven't been able to think of a better alternative. The problem is that most log frameworks already have a generic sounding name - e.g. Log::Dispatch - so somehow I have to name this in a way that distinguishes it from yet another logging framework.
        • I don't mean for $log, I mean for "category => '...'.

          That implies you are keeping inside Log::Any a hash of some sort with the class as the key and an object or log class as the value. That's what I meant by the class-level storage.

          As for ::Any, I notice that Log::Abstract seems to be unused at the moment, if you do a CPAN search for "Abstract" and have a read through some of the modules there, there is a precent for this general type of thing.
          • > As for ::Any, I notice that Log::Abstract seems to be unused at the moment, if you do a
            > CPAN search for "Abstract" and have a read through some of the modules there, there is a
            > precent for this general type of thing.

            Thanks, I like that name much better! "Any" has always seemed rather...indecisive. I'm going to retroactively change this in the journal entry.

            > I don't mean for $log, I mean for "category => '...'.
            >
            > That implies you are keeping inside Log::Any a hash of some sort with