-
-
Save anonymous/5cca91a0f7c73751cde610b644aeae19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Mojo/Log.pm b/lib/Mojo/Log.pm | |
index 007d95387..19493adb9 100644 | |
--- a/lib/Mojo/Log.pm | |
+++ b/lib/Mojo/Log.pm | |
@@ -28,7 +28,8 @@ sub append { | |
return unless my $handle = $self->handle; | |
flock $handle, LOCK_EX; | |
- $handle->print(encode('UTF-8', $msg)) or croak "Can't write to log: $!"; | |
+ $handle->print(encode('UTF-8', $msg)) | |
+ or delete($self->{handle}) && croak "Can't write to log: $!"; | |
flock $handle, LOCK_UN; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment