Skip to content
Snippets Groups Projects
Commit 9825c136 authored by dyszczo's avatar dyszczo
Browse files

fix(notice): fatal when trying to write into unwritable

parent 935f2b01
No related branches found
No related tags found
1 merge request!15fix(notice): Notice error when cannot create log file
Pipeline #7166 failed
...@@ -87,6 +87,10 @@ class WPCapture { ...@@ -87,6 +87,10 @@ class WPCapture {
} }
} }
if (!is_writable($log_file)) {
$this->add_notice_for_file($log_file);
return false;
}
return true; return true;
} }
......
...@@ -114,8 +114,10 @@ class WPDeskLoggerFactory extends BasicLoggerFactory ...@@ -114,8 +114,10 @@ class WPDeskLoggerFactory extends BasicLoggerFactory
*/ */
private function appendMainLog($logger) { private function appendMainLog($logger) {
$wpCapture = $this->captureWPLog(); $wpCapture = $this->captureWPLog();
if (is_writable($wpCapture->get_log_file())) {
$this->appendFileLog($logger, $wpCapture->get_log_file()); $this->appendFileLog($logger, $wpCapture->get_log_file());
} }
}
/** /**
* @param Logger $logger * @param Logger $logger
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment