Skip to content

Instantly share code, notes, and snippets.

@hirose31
Created February 15, 2013 05:55
Show Gist options
  • Save hirose31/4958764 to your computer and use it in GitHub Desktop.
Save hirose31/4958764 to your computer and use it in GitHub Desktop.
package Log::Minimal::Emotional;
use strict;
use warnings;
use parent qw(Log::Minimal);
our $EMOTION = {
DEBUG => '(☼ Д ☼)',
INFO => 'm9(^Д^)',
WARN => '(´・ω・`)',
CRITICAL => '(; Д ) ゜ ゜',
};
$Log::Minimal::PRINT = sub {
my ( $time, $type, $message, $trace, $raw_message) = @_;
warn "$time ", ($EMOTION->{$type}||"[$type]"), " $message at $trace\n";
};
1;
__END__
=head1 NAME
Log::Minimal::Emotional - Emotional!!! but customizable logger.
=head1 SYNOPSIS
see L<Log::Minimal>, L<http://f.hatena.ne.jp/hirose31/20130215145419>
=cut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment