Skip to content

Commit

Permalink
Update log to be an actual shortcut instead of an attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus Ramberg committed Aug 20, 2015
1 parent e876336 commit c6de6af
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -13,7 +13,7 @@ use Time::HiRes ();
has [qw(app tx)];
has match =>
sub { Mojolicious::Routes::Match->new(root => shift->app->routes) };
has log => sub { shift->app->log };
sub log { $_[0]->app->log }

# Reserved stash values
my %RESERVED = map { $_ => 1 } (
Expand Down Expand Up @@ -409,12 +409,6 @@ a L<Mojolicious> object.
# Generate path
my $path = $c->app->home->rel_file('templates/foo/bar.html.ep');
=head2 log
A shortcut for $c->app->log
$c->log->debug('Hello Mojo');
=head2 match
my $m = $c->match;
Expand Down Expand Up @@ -546,6 +540,12 @@ L<Mojolicious::Plugin::DefaultHelpers> and L<Mojolicious::Plugin::TagHelpers>.
# Use a nested helper instead of the "reply" controller method
$c->helpers->reply->not_found;
=head2 log
A shortcut for $c->app->log
$c->log->debug('Hello Mojo');
=head2 on
my $cb = $c->on(finish => sub {...});
Expand Down

0 comments on commit c6de6af

Please sign in to comment.