Bio-WGS2NCBI
view release on metacpan or search on metacpan
lib/Bio/WGS2NCBI/Logger.pm view on Meta::CPAN
'ERROR' => 'red',
);
sub LOG ($$) {
my ($msg,$method) = @_;
# compose the message. Complex messages do some amount of introspection
# to figure out where the message originated.
my $log;
if ( $Complexity ) {
my ( $package, $file1up, $line1up, $sub ) = caller( 2 );
my ( $pack0up, $file, $line, $sub0up ) = caller( 1 );
$log = sprintf( "%s %s [%s %s] - %s\n", uc $method, $sub || '', $file, $line, $msg );
}
else {
$log = $method . ' ' . $msg . "\n";
}
# check if we are actually writing to the terminal rather than a file
if ( -t STDERR ) {
print STDERR colored( $log, $COLORS{$method} );
}
( run in 0.258 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )