Permalink
Browse files

Build results of 6a1b75c (on master)

  • Loading branch information...
2 parents 9d7b26c + 6a1b75c commit 35285aec42c960b2dac10b333075ada77b8175b5 Mark Swayne committed Sep 12, 2011
Showing with 28 additions and 23 deletions.
  1. +2 −1 META.yml
  2. +2 −1 Makefile.PL
  3. +1 −1 README
  4. +1 −1 dist.ini
  5. +9 −7 lib/Log/Lager.pm
  6. +5 −5 lib/Log/Lager/CommandParser.pm
  7. +4 −3 lib/Log/Lager/Message.pm
  8. +4 −4 t/logfile
View
@@ -23,11 +23,12 @@ requires:
Exporter: 0
Hash::Util: 0
IO::File: 0
+ IO::Handle: 0
JSON::XS: 0
Scalar::Util: 0
Sys::Hostname: 0
Sys::Syslog: 0
Time::HiRes: 0
constant: 0
overload: 0
-version: 0.04
+version: 0.04.01
View
@@ -31,6 +31,7 @@ my %WriteMakefileArgs = (
'Exporter' => '0',
'Hash::Util' => '0',
'IO::File' => '0',
+ 'IO::Handle' => '0',
'JSON::XS' => '0',
'Scalar::Util' => '0',
'Sys::Hostname' => '0',
@@ -39,7 +40,7 @@ my %WriteMakefileArgs = (
'constant' => '0',
'overload' => '0'
},
- 'VERSION' => '0.04',
+ 'VERSION' => '0.04.01',
'test' => {
'TESTS' => 't/*.t t/CommandParser/*.t t/Message/*.t'
}
View
2 README
@@ -1,7 +1,7 @@
This archive contains the distribution Log-Lager,
-version 0.04:
+version 0.04.01:
Easy to use, flexible, parsable logs.
View
@@ -1,5 +1,5 @@
name = Log-Lager
-version = 0.04
+version = 0.04.01
author = Mark Swayne <daotoad@cpan.org>
main_module = lib/Log/Lager.pm
license = Perl_5
View
@@ -1,6 +1,6 @@
package Log::Lager;
BEGIN {
- $Log::Lager::VERSION = '0.04';
+ $Log::Lager::VERSION = '0.04.01';
}
use Data::Dumper;
@@ -11,6 +11,7 @@ use Carp qw( croak );
$Carp::Internal{'Log::Lager'}++;
use Scalar::Util qw(reftype);
use JSON::XS;
+use IO::Handle;
use Log::Lager::CommandParser qw( parse_command );
use Log::Lager::Message;
@@ -343,17 +344,14 @@ sub _handle_message {
my ($on_bit, $die_bit, $pretty_bit, $stack_bit ) =_get_bits(2, $MASK_CHARS{$level}[BITFLAG]);
- return if !$on_bit && !defined wantarray;
-
- my $formatter = $pretty_bit ? \&_pretty_formatter : \&_compact_formatter;
-
# Get raw messages from either callback or @_
my @messages;
{ no warnings 'uninitialized';
if( @_ == 1
&& reftype($_[0]) eq 'CODE'
) {
+ return if !$on_bit;
@messages = $_[0]->();
}
else {
@@ -363,6 +361,7 @@ sub _handle_message {
my $msg;
my @return_values;
+ my $return_exception;
# Is @messages a single entry of type Log::Lager::Message? -
if( eval {
@messages == 1
@@ -383,8 +382,10 @@ sub _handle_message {
my $rv = $msg->return_values;
@return_values = @$rv if ref($rv) eq 'ARRAY';
+ $return_exception = $msg->return_exception;
}
else {
+ return if !$on_bit;
$msg = $DEFAULT_MESSAGE_CLASS->new(
context => 0,
loglevel => $MASK_CHARS{$level}[FUNCTION],
@@ -409,6 +410,7 @@ sub _handle_message {
load_config_file();
}
+ die $return_exception if defined $return_exception;
return if !defined wantarray;
return @return_values if wantarray;
return $return_values[0] if @return_values <= 1;
@@ -418,7 +420,7 @@ sub _handle_message {
# Output type specific handlers
sub _output_stderr {
my ($level, $message) = @_;
- warn "$message\n";
+ STDERR->printflush( "$message" );
return;
}
@@ -624,7 +626,7 @@ Log::Lager - Easy to use, flexible, parsable logs.
=head1 VERSION
-version 0.04
+version 0.04.01
=head1 SYNOPSIS
@@ -1,6 +1,6 @@
package Log::Lager::CommandParser;
BEGIN {
- $Log::Lager::CommandParser::VERSION = '0.04';
+ $Log::Lager::CommandParser::VERSION = '0.04.01';
}
use strict;
use warnings;
@@ -135,7 +135,7 @@ TEST:
BEGIN {
package Log::Lager::CommandResult;
BEGIN {
- $Log::Lager::CommandResult::VERSION = '0.04';
+ $Log::Lager::CommandResult::VERSION = '0.04.01';
}
use overload '""' => 'as_string';
@@ -256,7 +256,7 @@ BEGIN {
BEGIN {
package Log::Lager::Mask;
BEGIN {
- $Log::Lager::Mask::VERSION = '0.04';
+ $Log::Lager::Mask::VERSION = '0.04.01';
}
use overload '""' => 'as_string';
use constant GROUP_PAIRS => (
@@ -379,7 +379,7 @@ BEGIN {
BEGIN {
package Log::Lager::Command;
BEGIN {
- $Log::Lager::Command::VERSION = '0.04';
+ $Log::Lager::Command::VERSION = '0.04.01';
}
=pod
@@ -576,7 +576,7 @@ Log::Lager::CommandParser
=head1 VERSION
-version 0.04
+version 0.04.01
=head1 SYNOPSIS
View
@@ -1,6 +1,6 @@
package Log::Lager::Message;
BEGIN {
- $Log::Lager::Message::VERSION = '0.04';
+ $Log::Lager::Message::VERSION = '0.04.01';
}
use strict;
use warnings;
@@ -30,6 +30,7 @@ use constant _RW_ATTR => qw(
want_stack
expanded_format
return_values
+ return_exception
);
use constant {
@@ -187,7 +188,7 @@ sub _callstack {
my @args;
{ package DB;
BEGIN {
- $DB::VERSION = '0.04';
+ $DB::VERSION = '0.04.01';
}
@env = caller($level);
@args = @DB::args if $env[ Log::Lager::Message::HAS_ARGS ];
@@ -334,7 +335,7 @@ Log::Lager::Message
=head1 VERSION
-version 0.04
+version 0.04.01
=head1 SYNOPSIS
View
@@ -1,10 +1,10 @@
BEGIN MESSAGE
[
[
- "2011-09-09 01:01:19.871 Z",
+ "2011-09-12 22:44:52.436 Z",
"GUTS",
"jolt.sea",
- 14709,
+ 17664,
0,
"t/03-lexical_loglevels.t",
"(eval 145)",
@@ -65,10 +65,10 @@ BEGIN MESSAGE
]
Exception thrown - [
[
- "2011-09-09 01:01:19.871 Z",
+ "2011-09-12 22:44:52.436 Z",
"GUTS",
"jolt.sea",
- 14709,
+ 17664,
0,
"t/03-lexical_loglevels.t",
"(eval 145)",

0 comments on commit 35285ae

Please sign in to comment.