Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log shortcut. #1270

Closed
wants to merge 2 commits into from
Closed

Add log shortcut. #1270

wants to merge 2 commits into from

Conversation

marcusramberg
Copy link
Member

This PR adds a log shortcut to Mojolicious::Controller,
and updates guides and helpers to use it

Writing $self->app->log over and over feels tedious, this
PR makes Mojolicious more fun to use ;)

As discussed on IRC.

Copy link
Member

@jhthorsen jhthorsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very positive to this change, but I was wondering if it should've been in in Mojolicious::Plugin::DefaultHelpers instead? My reasoning is that there might be users out there that has already added their own "log" helper, and I that won't be called after this change.

lib/Mojolicious/Controller.pm Outdated Show resolved Hide resolved
=head2 log

Shortcut for app->log. Gives you the L<Mojolicious> application log object,
usually a L<Mojo::Log> object.
Copy link
Member

@jhthorsen jhthorsen Oct 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this lacks the normal call/return examples above the text.

@kraih
Copy link
Member

kraih commented Oct 8, 2018

Yea, this change kills log helpers.

@marcusramberg
Copy link
Member Author

Thanks for the feedback, closing this PR and will reopen it as a new PR with a branch from my fork, as a helper.

@marcusramberg marcusramberg deleted the log_shortcut branch October 8, 2018 11:34
@marcusramberg marcusramberg mentioned this pull request Oct 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants