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.020'; # 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.020

=head1 SYNOPSIS

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



( run in 0.480 second using v1.01-cache-2.11-cpan-13bb782fe5a )