Package Info

perl-Log-Any


Bringing loggers and listeners together


Development/Libraries/Perl

'Log::Any' provides a standard log production API for modules. Log::Any::Adapter allows applications to choose the mechanism for log consumption, whether screen, file or another logging mechanism like Log::Dispatch or Log::Log4perl.

Many modules have something interesting to say. Unfortunately there is no standard way for them to say it - some output to STDERR, others to 'warn', others to custom file logs. And there is no standard way to get a module to start talking - sometimes you must call a uniquely named method, other times set a package variable.

This being Perl, there are many logging mechanisms available on CPAN. Each has their pros and cons. Unfortunately, the existence of so many mechanisms makes it difficult for a CPAN author to commit his/her users to one of them. This may be why many CPAN modules invent their own logging or choose not to log at all.

To untangle this situation, we must separate the two parts of a logging API. The first, log production, includes methods to output logs (like '$log->debug') and methods to inspect whether a log level is activated (like '$log->is_debug'). This is generally all that CPAN modules care about. The second, log consumption, includes a way to configure where logging goes (a file, the screen, etc.) and the code to send it there. This choice generally belongs to the application.

A CPAN module uses 'Log::Any' to get a log producer object. An application, in turn, may choose one or more logging mechanisms via Log::Any::Adapter, or none at all.

'Log::Any' has a very tiny footprint and no dependencies beyond Perl 5.8.1, which makes it appropriate for even small CPAN modules to use. It defaults to 'null' logging activity, so a module can safely log without worrying about whether the application has chosen (or will ever choose) a logging mechanism.

See http://www.openswartz.com/2007/09/06/standard-logging-api/ for the original post proposing this module.


License: Artistic-1.0 or GPL-1.0+
URL: http://search.cpan.org/dist/Log-Any/

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
1.705-bp156.3.1 info GA Release 2023-07-22 15 SP6
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Log-Any
1.705-bp155.2.12 info GA Release 2023-05-17 15 SP5
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Log-Any
1.705-bp154.1.63 info GA Release 2022-05-09 15 SP4
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Log-Any
1.705-bp153.1.19 info GA Release 2021-03-06 15 SP3
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Log-Any
1.705-bp152.3.23 info GA Release 2020-04-16 15 SP2
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Log-Any
1.705-bp151.3.1 info GA Release 2019-07-16 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Log-Any
1.705-bp151.2.15 info GA Release 2019-05-18 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Log-Any
1.705-bp150.2.4 info GA Release 2018-07-30 15
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Log-Any