]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 18 Feb 2023 22:51:31 +0000 (23:51 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 18 Feb 2023 22:51:31 +0000 (23:51 +0100)
- no need for initializing the debug sub-system with an empty message string

framework/main/classes/class_BaseFrameworkSystem.php
framework/main/middleware/debug/class_DebugMiddleware.php

index 57f241098e74d616981d8b538b40dca24168e1c8..e77f645c92b4323a0beb086478c7275f8f7e980c 100644 (file)
@@ -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
index 0f693dd57a548c3ebc92a4c0498b666745cf4904..d4ff279a0074f696ac8b25fdd2ce035922af2f5a 100644 (file)
@@ -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?