ChangeLog for Log-Contextual
+ - Yell loudly if a user tries to use Log::Contextual::set_logger() or
+ Log::Contextual::with_logger() (aka internals that don't work anymore)
+ directly
+
0.005002 2013-02-14 (♥)
- Fix RT#83267 (Tyler Riddle)
$class->router->after_import(%router_args);
}
+for (qw(set with)) {
+ no strict 'refs';
+ my $sub = "${_}_logger";
+ *{"Log::Contextual::$sub"} = sub {
+ die "$sub is no longer a direct sub in Log::Contextual. " .
+ 'Note that this feature was never tested nor documented. ' .
+ "Please fix your code to import $sub instead of trying to use it directly"
+ }
+}
+
1;
__END__
--- /dev/null
+use strict;
+use warnings;
+
+use Test::More tests => 2;
+use Test::Fatal;
+use Log::Contextual qw(:log);
+
+like(
+ exception { Log::Contextual::set_logger() },
+ qr/set_logger is no longer a direct sub in Log::Contextual/,
+ 'Log::Contextual::set_logger dies',
+);
+
+like(
+ exception { Log::Contextual::with_logger() },
+ qr/with_logger is no longer a direct sub in Log::Contextual/,
+ 'Log::Contextual::with_logger dies',
+);