Log::Dump::Functions - Log::Dump::Functions documentation


Log-Dump documentation Contained in the Log-Dump distribution.

Index


Code Index:

NAME

Top

Log::Dump::Functions

SYNOPSIS

Top

  use Log::Dump::Functions;

  log( debug => 'foo' );

DESCRIPTION

Top

You usually want to use this for a simple script. Usage is the same as Log::Dump, except that you don't need to write __PACKAGE__-> or $self->.

AUTHOR

Top

Kenichi Ishigaki, <ishigaki@cpan.org>

COPYRIGHT AND LICENSE

Top


Log-Dump documentation Contained in the Log-Dump distribution.

package Log::Dump::Functions;

use strict;
use warnings;
use Log::Dump;
use Sub::Install 'install_sub';

our @CARP_NOT;

sub import {
  my $class = shift;
  my $caller = caller;

  my @methods = qw( logger log logfile logfilter logcolor );
  foreach my $method (@methods) {
    install_sub({
      as   => $method,
      into => $caller,
      code => sub { $class->$method(@_) },
    });
  }
}

1;

__END__