diff --git a/CHANGELOG.md b/CHANGELOG.md index 798336ec..39356041 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,13 +3,14 @@ All notable changes to **DecaLog** are documented in this *changelog*. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and **DecaLog** adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [4.1.0] - Not Yet Released +## [4.1.0] - 2024-05-28 ### Added - New listener for [WP Migrate](https://wordpress.org/plugins/wp-migrate-db/) Lite & Pro. ### Fixed - [WP-CLI] PHP error in some cases when Elastic Cloud is a running logger. +- Some failing loggers may not be able to report their health state. ## [4.0.0] - 2024-05-13 diff --git a/includes/features/class-dlogger.php b/includes/features/class-dlogger.php index 048d59d0..7d140d5f 100644 --- a/includes/features/class-dlogger.php +++ b/includes/features/class-dlogger.php @@ -344,7 +344,7 @@ public function log( $level, $message, $code = 0, $phase = '', $signal = true ) if ( $debug && ! $this->is_debug_allowed() ) { return false; } - //try { + try { $context = [ 'class' => (string) $this->class, 'component' => (string) $this->name, @@ -361,18 +361,18 @@ public function log( $level, $message, $code = 0, $phase = '', $signal = true ) } $result = true; // phpcs:ignore - //set_error_handler( function () use (&$result) {$result = false;} ); + set_error_handler( function () use (&$result) {$result = false;} ); $this->logger->log( $level, $this->normalize_string( $message ), $this->normalize_array( $context ) ); // phpcs:ignore - //restore_error_handler(); - /*} catch ( \Throwable $t ) { + restore_error_handler(); + } catch ( \Throwable $t ) { $result = false; } finally { if ( $signal && ! $result && ! $debug ) { //$this->log( Logger::ALERT, 'error', 666, '', false ); - }*/ + } return $result; - //} + } } /**