App-Oozie

 view release on metacpan or  search on metacpan

lib/App/Oozie/Role/Info.pm  view on Meta::CPAN

package App::Oozie::Role::Info;

use 5.014;
use strict;
use warnings;

our $VERSION = '0.016'; # VERSION

use namespace::autoclean -except => [qw/_options_data _options_config/];

use Moo::Role;
use Ref::Util qw( is_arrayref );

with qw(
    App::Oozie::Role::Log
);

sub log_versions {
    my $self      = shift;
    my $log_level = shift || 'debug';
    my $me        = ref $self;
    my @classes   = ( [ $me, $self->VERSION ] );

    my $base_class = do {
        no strict qw(refs);
        my @isa =   grep { $_ ne $me }
                    map  {
                        is_arrayref $_ ? @{ $_ } : $_
                    }
                    @{ $me . '::ISA' };
        @isa ? $isa[0] : ();
    };

    if ( $base_class ) {
        push @classes, [ $base_class, $base_class->VERSION ];
    }

    for my $tuple ( @classes ) {
        my($name, $v) = @{ $tuple };
        my $msg = defined $v
                ? sprintf 'Running under %s %s', $name, $v
                : sprintf 'Running under %s', $name
                ;
        $self->logger->$log_level( $msg );
    }

    return;
}

1;

__END__

=pod

=encoding UTF-8

=head1 NAME

App::Oozie::Role::Info

=head1 VERSION

version 0.016

=head1 SYNOPSIS

    use Moo;
    with qw(
        App::Oozie::Role::Info
    );
    sub method {

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.526 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )