ok(eval { log_warn { die 'this should live' }; 1}, 'warn does not get called');
ok(eval { log_error { die 'this should live' }; 1}, 'error does not get called');
ok(eval { log_fatal { die 'this should live' }; 1}, 'fatal does not get called');
+
+{
+ my $cap;
+ local *STDERR = do { open my $fh, '>', \$cap; $fh };
+
+ log_debug { 'frew' };
+ is($cap, "[debug] frew\n", 'SimpleLogger outputs to STDERR correctly');
+}
+
+my $response;
+my $l2 = Log::Contextual::SimpleLogger->new({
+ levels => [qw{trace debug info warn error fatal}],
+ coderef => sub { $response = $_[0] },
+});
+set_logger($l2);
+log_trace { 'trace' };
+is($response, "[trace] trace\n", 'trace renders correctly');
+log_debug { 'debug' };
+is($response, "[debug] debug\n", 'debug renders correctly');
+log_info { 'info' };
+is($response, "[info] info\n", 'info renders correctly');
+log_warn { 'warn' };
+is($response, "[warn] warn\n", 'warn renders correctly');
+log_error { 'error' };
+is($response, "[error] error\n", 'error renders correctly');
+log_fatal { 'fatal' };
+is($response, "[fatal] fatal\n", 'fatal renders correctly');
+