]> git.mxchange.org Git - core.git/blobdiff - framework/main/interfaces/logging/class_Logger.php
Continued:
[core.git] / framework / main / interfaces / logging / class_Logger.php
diff --git a/framework/main/interfaces/logging/class_Logger.php b/framework/main/interfaces/logging/class_Logger.php
new file mode 100644 (file)
index 0000000..2e7a2cf
--- /dev/null
@@ -0,0 +1,123 @@
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Logging;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+
+/**
+ * A Logger interface
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Logger extends FrameworkInterface {
+
+       // Logger levels
+       const LOGGER_LEVEL_DEBUG      = 'DEBUG';
+       const LOGGER_LEVEL_DEPRECATED = 'DEPRECATED';
+       const LOGGER_LEVEL_INFO       = 'INFO';
+       const LOGGER_LEVEL_TRACE      = 'TRACE';
+       const LOGGER_LEVEL_WARNING    = 'WARNING';
+
+       /**
+        * Outputs a trace message whether to debug instance (should be set!) or
+        * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
+        * ApplicationEntryPoint::app_exit(), this would cause an endless loop.
+        *
+        * @param       $message        Message we shall send out...
+        * @param       $doPrint        Whether print or die here (default: print)
+        * @paran       $stripTags      Whether to strip tags (default: false)
+        * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      NullPointerException    If this->outputInstance is NULL
+        * @todo        Remove $doPrint parameter
+        */
+       public function traceMessage (string $message, bool $doPrint = true, bool $stripTags = false);
+
+       /**
+        * Outputs a debug message whether to debug instance (should be set!) or
+        * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
+        * ApplicationEntryPoint::app_exit(), this would cause an endless loop.
+        *
+        * @param       $message        Message we shall send out...
+        * @param       $doPrint        Whether print or die here (default: print)
+        * @paran       $stripTags      Whether to strip tags (default: false)
+        * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      NullPointerException    If this->outputInstance is NULL
+        * @todo        Remove $doPrint parameter
+        */
+       public function debugMessage (string $message, bool $doPrint = true, bool $stripTags = false);
+
+       /**
+        * Outputs an informational message whether to debug instance (should be set!) or
+        * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
+        * ApplicationEntryPoint::app_exit(), this would cause an endless loop.
+        *
+        * @param       $message        Message we shall send out...
+        * @param       $doPrint        Whether print or die here (default: print)
+        * @paran       $stripTags      Whether to strip tags (default: false)
+        * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      NullPointerException    If this->outputInstance is NULL
+        * @todo        Remove $doPrint parameter
+        */
+       public function infoMessage (string $message, bool $doPrint = true, bool $stripTags = false);
+
+       /**
+        * Outputs a warning message whether to debug instance (should be set!) or
+        * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
+        * ApplicationEntryPoint::app_exit(), this would cause an endless loop.
+        *
+        * @param       $message        Message we shall send out...
+        * @param       $doPrint        Whether print or die here (default: print)
+        * @paran       $stripTags      Whether to strip tags (default: false)
+        * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      NullPointerException    If this->outputInstance is NULL
+        * @todo        Remove $doPrint parameter
+        */
+       public function warningMessage (string $message, bool $doPrint = true, bool $stripTags = false);
+
+       /**
+        * Output a partial stub message for the caller method
+        *
+        * @param       $message        An optional message to display
+        * @return      void
+        */
+       public function partialStub (string $message = '');
+
+       /**
+        * Outputs a deprecated message whether to debug instance (should be set!) or
+        * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
+        * ApplicationEntryPoint::app_exit(), this would cause an endless loop.
+        *
+        * @param       $message        Message we shall send out...
+        * @param       $doPrint        Whether print or die here (default: print)
+        * @paran       $stripTags      Whether to strip tags (default: false)
+        * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      NullPointerException    If this->outputInstance is NULL
+        * @todo        Remove $doPrint parameter
+        * @todo        When all old method invocations are fixed, renamed this do deprecatedMessage
+        */
+       public function debugOutput (string $message, bool $doPrint = true, bool $stripTags = false);
+
+}