Skip to content
Snippets Groups Projects
Commit f1d4afb9 authored by Dyszczo's avatar Dyszczo
Browse files

Merge branch 'bugfix/notice' into 'master'

fix(notice): Notice error when cannot create log file

See merge request !15
parents 8826da3e 9825c136
No related branches found
No related tags found
1 merge request!15fix(notice): Notice error when cannot create log file
Pipeline #7228 failed
## [1.6.2] - 2020-07-21
### Fixed
- Notice error when cannot create log file
## [1.6.1] - 2020-05-25 ## [1.6.1] - 2020-05-25
### Fixed ### Fixed
- WooCommerceCapture checks if WC exists before proceeding - WooCommerceCapture checks if WC exists before proceeding
......
...@@ -27,7 +27,7 @@ class WPCapture { ...@@ -27,7 +27,7 @@ class WPCapture {
), ),
$dir $dir
), ),
WPDesk\Notice\Notice::NOTICE_TYPE_ERROR \WPDesk\Notice\Notice::NOTICE_TYPE_ERROR
); );
} }
...@@ -46,7 +46,7 @@ class WPCapture { ...@@ -46,7 +46,7 @@ class WPCapture {
), ),
$file $file
), ),
WPDesk\Notice\Notice::NOTICE_TYPE_ERROR \WPDesk\Notice\Notice::NOTICE_TYPE_ERROR
); );
} }
...@@ -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