NAME

Log::ger::Plugin::Multisets - Create multiple sets of logger routines, each set with its own init arguments

VERSION

version 0.001

SYNOPSIS

Instead of having to resort to OO style to log to different categories:

use Log::ger ();

my $access_log = Log::ger->get_logger(category => 'access');
my $error_log  = Log::ger->get_logger(category => 'error');

$access_log->info ("goes to access log");
$access_log->warn ("goes to access log");
$error_log ->warn ("goes to error log");
$error_log ->debug("goes to error log");
...

you can instead:

use Log::ger::Plugin Multisets => (
    log_sub_prefixes => {
        # prefix  => init args
        log_      => {category=>'error' }, # or undef, to use the default init args (including category)
        access_   => {category=>'access'},
    },
    is_sub_prefixes => {
        # prefix   => category
        is_        => {category=>'error' },
        access_is_ => {category=>'access'},
    },
);
use Log::ger;

access_info "goes to access log";
access_warn "goes to access log";
log_warn    "goes to error log";
log_debug   "goes to error log";
...

DESCRIPTION

This plugin lets you create multiple sets of logger subroutines, each set with its own init arguments. This can be used e.g. when you want to log to different categories without resorting to OO style.

CONFIGURATION

log_sub_prefixes

Hash.

is_sub_prefixes

Hash.

log_method_prefixes

Hash.

is_method_prefixes

Hash.

SEE ALSO

Log::ger

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2020 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.