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
Tags 1.6.2
1 merge request!15fix(notice): Notice error when cannot create log file
Pipeline #7228 failed with stages
in 2 minutes and 33 seconds
## [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,7 +87,11 @@ class WPCapture { ...@@ -87,7 +87,11 @@ class WPCapture {
} }
} }
return true; if (!is_writable($log_file)) {
$this->add_notice_for_file($log_file);
return false;
}
return true;
} }
/** /**
......
...@@ -114,7 +114,9 @@ class WPDeskLoggerFactory extends BasicLoggerFactory ...@@ -114,7 +114,9 @@ class WPDeskLoggerFactory extends BasicLoggerFactory
*/ */
private function appendMainLog($logger) { private function appendMainLog($logger) {
$wpCapture = $this->captureWPLog(); $wpCapture = $this->captureWPLog();
$this->appendFileLog($logger, $wpCapture->get_log_file()); if (is_writable($wpCapture->get_log_file())) {
$this->appendFileLog($logger, $wpCapture->get_log_file());
}
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment