forked from mschilli/log4perl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented suggestion by Neil Hooey to check for and report
undefined message elements before they're assembled in Appender.pm and a warning is issued without a proper code location: mschilli#15
- Loading branch information
Showing
3 changed files
with
48 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use strict; | ||
|
||
use File::Temp qw( tempfile ); | ||
|
||
BEGIN { | ||
if($ENV{INTERNAL_DEBUG}) { | ||
require Log::Log4perl::InternalDebug; | ||
Log::Log4perl::InternalDebug->enable(); | ||
} | ||
} | ||
|
||
my($tmpfh, $tempfile) = tempfile( UNLINK => 1 ); | ||
|
||
use Test::More; | ||
BEGIN { plan tests => 1 }; | ||
use Log::Log4perl qw( :easy ); | ||
|
||
Log::Log4perl->easy_init( { level => $DEBUG, file => $tempfile } ); | ||
|
||
my $warnings = ""; | ||
|
||
$SIG{__WARN__} = sub { | ||
$warnings .= $_[0]; | ||
}; | ||
|
||
DEBUG "foo", undef, "bar"; | ||
|
||
like $warnings, qr/Log message argument #2/, "warning for undef element issued"; |