Skip to content

Commit

Permalink
tutorial tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 8, 2013
1 parent 0616d0a commit c1fb1db
Showing 1 changed file with 19 additions and 32 deletions.
51 changes: 19 additions & 32 deletions lib/Mojolicious/Lite.pm
Expand Up @@ -136,7 +136,7 @@ just work without commands.
=head2 Start
The app->start call that starts the L<Mojolicious> command system can be
The C<app-E<gt>start call that starts the L<Mojolicious> command system can be
customized to override normal C<@ARGV> use.
app->start('cgi');
Expand Down Expand Up @@ -897,6 +897,24 @@ L<Mojolicious::Controller/"send">.
</head>
</html>
=head2 Mode
To disable debug messages later in a production setup, you can change the
L<Mojolicious> operating mode with command line options or the MOJO_MODE
environment variable, the default will usually be C<development>.
$ ./myapp.pl daemon -m production
This also affects many other aspects of the framework, such as mode specific
C<exception> and C<not_found> templates.
=head2 Logging
L<Mojo::Log> messages will be automatically written to C<STDERR> or a
C<log/$mode.log> file if a C<log> directory exists.
$ mkdir log
=head2 Testing
Testing your application is as easy as creating a C<t> directory and filling
Expand All @@ -923,37 +941,6 @@ change the application log level directly in your test files.
$t->app->log->level('debug');
=head2 Mode
To disable debug messages later in a production setup, you can change the
L<Mojolicious> operating mode with command line options or the MOJO_MODE
environment variable, the default will usually be C<development>.
$ ./myapp.pl daemon -m production
This also affects many other aspects of the framework, such as mode specific
C<exception> and C<not_found> templates.
=head2 Logging
L<Mojo::Log> messages will be automatically written to C<STDERR> or a
C<log/$mode.log> file if a C<log> directory exists.
$ mkdir log
For more control the L<Mojolicious> object can be accessed directly.
use Mojolicious::Lite;
app->log->level('error');
app->routes->get('/foo/:bar' => sub {
my $self = shift;
$self->app->log->debug('Got a request for "Hello Mojo!".');
$self->render(text => 'Hello Mojo!');
});
app->start;
=head2 More
You can continue with L<Mojolicious::Guides> now, and don't forget to have
Expand Down

0 comments on commit c1fb1db

Please sign in to comment.