You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use Mojo::Log;
my $log = Mojo::Log->new(path => 'app.log')->info('Core log object');
my $child_log = $log->context('[stream id 1234]');
my $grandchild_log = $child_log->context('[stream id 1234]', '[username foo]')->info('Grandchild log object');
Expected behavior
Expected that all messages would be logged to the file.
Actual behavior
'Grandchild log object' is not logged to the file and is output to the terminal instead.
This only happens if $child_log has not been used to log. If/once it has, the message goes to the file as expected.
Implemented workaround
Adding a Log class that inherits from Mojo::Log and passes the parent instead of itself as the parent (if it exists), was an acceptable workaround for this application (at least, for the time being), but other side-effects of doing this aren't known/explored.
Steps to reproduce the behavior
Expected behavior
Expected that all messages would be logged to the file.
Actual behavior
'Grandchild log object' is not logged to the file and is output to the terminal instead.
This only happens if $child_log has not been used to log. If/once it has, the message goes to the file as expected.
Implemented workaround
Adding a Log class that inherits from Mojo::Log and passes the parent instead of itself as the parent (if it exists), was an acceptable workaround for this application (at least, for the time being), but other side-effects of doing this aren't known/explored.
The text was updated successfully, but these errors were encountered: