use Data::Dumper::Concise;
use Scalar::Util 'blessed';
+my @dlog = ((map "Dlog_$_", @levels), (map "DlogS_$_", @levels));
+
+my @log = ((map "log_$_", @levels), (map "logS_$_", @levels));
+
eval {
require Log::Log4perl;
die if $Log::Log4perl::VERSION < 1.29;
# export anything but the levels selected
sub ____ { }
-exports(qw(____ set_logger with_logger ));
+exports ('____',
+ @dlog, @log,
+ qw( set_logger with_logger )
+);
export_tag dlog => ('____');
export_tag log => ('____');
--- /dev/null
+use Test::More qw(no_plan);
+
+BEGIN {
+ #an optional expanded test mode
+ if (0) {
+ eval {
+ package NotMain;
+
+ use strict;
+ use warnings;
+ use Test::More;
+ use Log::Contextual::SimpleLogger;
+
+ use Log::Contextual qw(:log),
+ -default_logger =>
+ Log::Contextual::SimpleLogger->new({levels => [qw( )]});
+
+ eval {
+ log_info { "Yep" }
+ };
+ is($@, '', 'Invoked log function in package other than main');
+ };
+
+ is($@, '', 'non-main package subtest did not die');
+ }
+}
+
+package main;
+
+use strict;
+use warnings;
+use Test::More;
+
+#bug report does not include a case where Log::Contextual is
+#brought in via 'use'
+require Log::Contextual;
+
+#try to import a single log function but do not include any tags
+eval { Log::Contextual->import('log_info') };
+is($@, '', 'Imported log function with out dying');
+
+#don't try to invoke the function for now
+#eval { log_info { "test" } 1 };
+#is($@, '', 'Was able to invoke log function');