Note that MOJO_DAEMON_DEBUG (and similar environment variables) does not 
use Mojo::Log, but simply print to screen using "warn":

https://metacpan.org/source/SRI/Mojolicious-6.05/lib/Mojo/Server/Daemon.pm#L193

The reason I don't want them to screen is that they would clutter the 
"real" output from a script. Consider this:

  MOJO_USERAGENT_DEBUG=1 mojo get mojolicio.us 1>index.html 2>index.html.log

Using "print" instead of "warn" would result in an unexpected outcome.

On Saturday, April 4, 2015 at 1:56:17 AM UTC+2, Dan Book wrote:
>
> Also note this will affect all app log output, including errors.
>
> On Fri, Apr 3, 2015 at 7:55 PM, Dan Book <[email protected]> wrote:
>
>> $app->log->handle(\*STDOUT); (untested)
>>
>> On Fri, Apr 3, 2015 at 6:04 PM, Nathan Waddell <[email protected]> 
>> wrote:
>>
>>> After some research, it looks like this is because Mojo::Log defaults to 
>>> STDERR:
>>>
>>> has handle => sub {
>>>  
>>>   # STDERR
>>>   return \*STDERR unless my $path = shift->path;
>>>  
>>>   # File
>>>   croak qq{Can't open log file "$path": $!} unless open my $file, '>>', 
>>> $path;
>>>   return $file;
>>> };
>>>
>>> How would I configure hypnotoad to use STDOUT for Mojo::Log instead?
>>>
>>>
>>> On Friday, April 3, 2015 at 2:30:59 PM UTC-5, Nathan Waddell wrote:
>>>>
>>>> Setting the MOJO_DAEMON_DEBUG environment variable causes debugging 
>>>> messages to be printed to STDERR. Why does it use STDERR and not STDOUT? 
>>>> Debugging messages aren't errors, they are expected behavior in debugging 
>>>> mode.
>>>>
>>>  -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Mojolicious" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/mojolicious.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to