# This file documents the revision history for Perl extension Catalyst.
-5.90069_TBA
+5.90069_003
+ - The default log level is now 'info', not 'debug'.
- Finished merging all the encoding plugin code to core code. The encoding
plugin is now just an empty package. Also tried to improve encoding docs
a bit.
my $class = shift;
my $self = $class->$orig;
- $self->levels( scalar(@_) ? @_ : keys %LEVELS );
-
+ $self->levels( scalar(@_) ? @_ : (qw/info warn error fatal/) );
return $self;
};
ok $log->is_error, 'Errors should be enabled';
ok $log->is_fatal, 'Fatal errors should be enabled';
ok $log->is_info, 'Info should be enabled';
- ok $log->is_debug, 'Debugging should be enabled';
+ ok !$log->is_debug, 'Debugging should not be enabled';
ok !$c->debug, 'Catalyst debugging turned off';
}
my $log_meta = Class::MOP::Class->create_anon_class(
my $app = mock_app('TestAppLogEmptyString');
$app->setup_log('');
ok !$app->debug, 'Not In debug mode';
- # Note that by default, you get _all_ the log levels turned on
+ # Note that by default, you get _all_ the log levels turned on over debug
test_log_object($app->log,
fatal => 1,
error => 1,
warn => 1,
info => 1,
- debug => 1,
+ debug => 0,
);
}
{
$c->res->body( 'logged' );
}
+sub info :Local {
+ my ( $self, $c ) = @_;
+ $c->log->info('info');
+ $c->res->body( 'logged' );
+}
1;
test_psgi $app, sub {
my $cb = shift;
- my $res = $cb->(GET "/log/debug");
+ my $res = $cb->(GET "/log/info");
my @logs = $handle->logs;
cmp_ok(scalar(@logs), $cmp, 1, "psgi.errors: one event output");
- like($logs[0], qr/debug$/m, "psgi.errors: event matches test data");
+ like($logs[0], qr/info$/m, "psgi.errors: event matches test data");
};
};
test_psgi $app, sub {
my $cb = shift;
- my $res = $cb->(GET "/log/debug");
+ my $res = $cb->(GET "/log/info");
cmp_ok(scalar(@logs), $cmp, 1, "psgix.logger: one event logged");
- is(scalar(grep { $_->{level} eq 'debug' and $_->{message} eq 'debug' } @logs),
+ is(scalar(grep { $_->{level} eq 'info' and $_->{message} eq 'info' } @logs),
1, "psgix.logger: right stuff");
};
};