App-PPE

 view release on metacpan or  search on metacpan

lib/App/PPE.pm  view on Meta::CPAN

     P => 'CRITICAL',
     X => 'ERROR',
     A => 'ERROR',

     undef => 'UNKNOWN',
};

our $COLOR = {
    'warn' => {
        text       => 'black',
        background => 'yellow',
    },
    'critical' => {
        text       => 'black',
        background => 'red'
    },
    'error' => {
        text       => 'red',
        background => 'black'
    },
    'unknown' => {
        text       => 'white',
        background => 'red'
    }
};

our $FORMAT = sub {
    my ($tag, $type, $message, $file, $line) = @_;
    return "$file:$line: [$tag] ($type) $message";
};



lib/App/PPE.pm  view on Meta::CPAN


    return $color;
}

sub _prettify_tag {
    my ($self, $error_item) = @_;

    my $tag  = _tag($error_item);
    my $color = $self->_prettify_color($error_item);
    $tag = Term::ANSIColor::color($color->{text}) . $tag . Term::ANSIColor::color("reset") if $color->{text};
    $tag = Term::ANSIColor::color("on_".$color->{background}) . $tag . Term::ANSIColor::color("reset") if $color->{background};

    return $tag;
}

sub _prettify_type {
    my ($self, $error_item) = @_;
    return $error_item->type // 'undef';
}

sub _prettify_message {



( run in 0.670 second using v1.01-cache-2.11-cpan-d8267643d1d )