From 280798f3e8db2f8d5f6d0330081ec63e04414330 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 18 Feb 2023 23:51:31 +0100 Subject: [PATCH] Continued: - no need for initializing the debug sub-system with an empty message string --- framework/main/classes/class_BaseFrameworkSystem.php | 5 +---- .../main/middleware/debug/class_DebugMiddleware.php | 9 +-------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/framework/main/classes/class_BaseFrameworkSystem.php b/framework/main/classes/class_BaseFrameworkSystem.php index 57f24109..e77f645c 100644 --- a/framework/main/classes/class_BaseFrameworkSystem.php +++ b/framework/main/classes/class_BaseFrameworkSystem.php @@ -620,15 +620,12 @@ Loaded includes: // Try it try { // Get a debugger instance + //* NOISY-DEBUG: */ printf('[%s:%d]: className=%s' . PHP_EOL, __METHOD__, __LINE__, $className); self::$debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_class'), $className); } catch (NullPointerException $e) { // Didn't work, no instance there exit(sprintf('[%s:%d]: Cannot create debugInstance! Exception=%s,message=%s,className=%s,lineNumber=%d' . PHP_EOL, __METHOD__, __LINE__, $e->__toString(), $e->getMessage(), $className, $lineNumber)); } - - // Empty string should be ignored and used for testing the middleware - //* NOISY-DEBUG: */ printf('[%s:%d]: Invoking DebugMiddleware->selfInstance->output() ...' . PHP_EOL, __METHOD__, __LINE__); - DebugMiddleware::getSelfInstance()->output(''); } // Return it diff --git a/framework/main/middleware/debug/class_DebugMiddleware.php b/framework/main/middleware/debug/class_DebugMiddleware.php index 0f693dd5..d4ff279a 100644 --- a/framework/main/middleware/debug/class_DebugMiddleware.php +++ b/framework/main/middleware/debug/class_DebugMiddleware.php @@ -122,15 +122,8 @@ class DebugMiddleware extends BaseMiddleware implements Registerable { * @throws NullPointerException If this->outputInstance is NULL */ private function output (string $message, bool $stripTags = false) { - // Is the output stream set - //* NOISY-DEBUG: */ printf('[%s:%d]: message=%s,stripTags=%d - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $message, intval($stripTags)); - if (empty($message)) { - // @TODO Initialization phase - //* NOISY-DEBUG: */ printf('[%s:%d]: message is empty - EXIT!' . PHP_EOL, __METHOD__, __LINE__); - return; - } - // Get backtrace + //* NOISY-DEBUG: */ printf('[%s:%d]: message=%s,stripTags=%d - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $message, intval($stripTags)); $backtrace = debug_backtrace(!DEBUG_BACKTRACE_PROVIDE_OBJECT); // Is the deprecated debugOutput() or partialStub() invoked before? -- 2.39.5