Egg::Log::STDERR - Log message is output to STDERR.


Egg-Release documentation Contained in the Egg-Release distribution.

Index


Code Index:

NAME

Top

Egg::Log::STDERR - Log message is output to STDERR.

DESCRIPTION

Top

The log message is output to STDERR.

The object of this module can be acquired in the log method of the project object.

  my $log= $project->log;

METHODS

Top

new

Constructor.

error ([MESSAGE_STR])

MESSAGE_STR is output putting up ERROR to the head.

debug ([MESSAGE_STR])

MESSAGE_STR is output putting up DEBUG to the head.

info ([MESSAGE_STR])

MESSAGE_STR is output putting up INFO to the head.

notice ([MESSAGE_STR])

MESSAGE_STR is output putting up NOTES to the head.

SEE ALSO

Top

Egg::Release,

AUTHOR

Top

Masatoshi Mizuno <lushe&64;cpan.org>

COPYRIGHT AND LICENSE

Top


Egg-Release documentation Contained in the Egg-Release distribution.

package Egg::Log::STDERR;
#
# Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt>
#
# $Id: STDERR.pm 337 2008-05-14 12:30:09Z lushe $
#
use strict;
use warnings;

our $VERSION= '3.01';

sub new { bless [], $_[0] }

sub error  { shift; _print('ERROR' , @_) }
sub debug  { shift; _print('DEBUG' , @_) }
sub info   { shift; _print('INFO'  , @_) }
sub notice { shift; _print('NOTICE', @_) }

sub _print {
	my $lebel= shift;
	my $msg= $_[0] ? ($_[1] ? join("\n", @_): $_[0]): 'N/A';
	$msg.= "\n" unless $msg=~m{\n$};
	print STDERR "${lebel}: $msg";
}

1;

__END__