From 79a86e07b6fc75e3732b28a5bb73fa2bf7f3dd37 Mon Sep 17 00:00:00 2001 From: Leon Schmidt Date: Mon, 13 Apr 2026 19:06:20 +0200 Subject: [PATCH 1/3] Remove CHANGELOG.md --- CHANGELOG.md | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index fb5a63f..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,13 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [1.0.0] - 2026-04-09 - -### Public Release -- DebugPHP - -[1.0.0]: https://github.com/CallMeLeon167/debugphp/releases/tag/v1.0.0 \ No newline at end of file From 41d7f0107f1e4c3a8d916b606e030506413c6ac3 Mon Sep 17 00:00:00 2001 From: Leon Schmidt Date: Mon, 13 Apr 2026 19:06:41 +0200 Subject: [PATCH 2/3] Add log level methods for emergency, alert, critical, error, warning, notice, info, and debug --- src/Debug.php | 200 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) diff --git a/src/Debug.php b/src/Debug.php index 1fc0ebe..bfd612b 100644 --- a/src/Debug.php +++ b/src/Debug.php @@ -142,6 +142,206 @@ public static function send(mixed $data, string $label = ''): ?Entry return new Entry(self::$client, self::$config->getSession(), self::$requestId, $data, $label); } + /** + * Sends an emergency-level message to the dashboard. + * + * Emergency level indicates the system is unusable and requires immediate attention. + * Displayed with red color and "emergency" type in the dashboard. + * + * @param mixed $data The data to debug. + * @param string $label Optional label for categorization. + * + * @return Entry|null The created entry, or null if not ready. + */ + public static function emergency(mixed $data, string $label = 'Emergency'): ?Entry + { + if (!self::isReady()) { + return null; + } + + if (self::$client === null || self::$config === null) { + return null; + } + + $entry = new Entry(self::$client, self::$config->getSession(), self::$requestId, $data, $label); + return $entry->type('emergency')->color('red'); + } + + /** + * Sends an alert-level message to the dashboard. + * + * Alert level indicates action must be taken immediately. + * Displayed with red color and "alert" type in the dashboard. + * + * @param mixed $data The data to debug. + * @param string $label Optional label for categorization. + * + * @return Entry|null The created entry, or null if not ready. + */ + public static function alert(mixed $data, string $label = 'Alert'): ?Entry + { + if (!self::isReady()) { + return null; + } + + if (self::$client === null || self::$config === null) { + return null; + } + + $entry = new Entry(self::$client, self::$config->getSession(), self::$requestId, $data, $label); + return $entry->type('alert')->color('red'); + } + + /** + * Sends a critical-level message to the dashboard. + * + * Critical level indicates critical conditions that require immediate attention. + * Displayed with red color and "critical" type in the dashboard. + * + * @param mixed $data The data to debug. + * @param string $label Optional label for categorization. + * + * @return Entry|null The created entry, or null if not ready. + */ + public static function critical(mixed $data, string $label = 'Critical'): ?Entry + { + if (!self::isReady()) { + return null; + } + + if (self::$client === null || self::$config === null) { + return null; + } + + $entry = new Entry(self::$client, self::$config->getSession(), self::$requestId, $data, $label); + return $entry->type('critical')->color('red'); + } + + /** + * Sends an error-level message to the dashboard. + * + * Error level indicates runtime errors that should be logged and monitored. + * Displayed with red color and "error" type in the dashboard. + * + * @param mixed $data The data to debug. + * @param string $label Optional label for categorization. + * + * @return Entry|null The created entry, or null if not ready. + */ + public static function error(mixed $data, string $label = 'Error'): ?Entry + { + if (!self::isReady()) { + return null; + } + + if (self::$client === null || self::$config === null) { + return null; + } + + $entry = new Entry(self::$client, self::$config->getSession(), self::$requestId, $data, $label); + return $entry->type('error')->color('red'); + } + + /** + * Sends a warning-level message to the dashboard. + * + * Warning level indicates something unexpected happened but it's not an error. + * Displayed with orange color and "warning" type in the dashboard. + * + * @param mixed $data The data to debug. + * @param string $label Optional label for categorization. + * + * @return Entry|null The created entry, or null if not ready. + */ + public static function warning(mixed $data, string $label = 'Warning'): ?Entry + { + if (!self::isReady()) { + return null; + } + + if (self::$client === null || self::$config === null) { + return null; + } + + $entry = new Entry(self::$client, self::$config->getSession(), self::$requestId, $data, $label); + return $entry->type('warning')->color('orange'); + } + + /** + * Sends a notice-level message to the dashboard. + * + * Notice level indicates normal but significant events. + * Displayed with blue color and "notice" type in the dashboard. + * + * @param mixed $data The data to debug. + * @param string $label Optional label for categorization. + * + * @return Entry|null The created entry, or null if not ready. + */ + public static function notice(mixed $data, string $label = 'Notice'): ?Entry + { + if (!self::isReady()) { + return null; + } + + if (self::$client === null || self::$config === null) { + return null; + } + + $entry = new Entry(self::$client, self::$config->getSession(), self::$requestId, $data, $label); + return $entry->type('notice')->color('blue'); + } + + /** + * Sends an info-level message to the dashboard. + * + * Info level indicates general informational messages. + * Displayed with gray color and "info" type in the dashboard. + * + * @param mixed $data The data to debug. + * @param string $label Optional label for categorization. + * + * @return Entry|null The created entry, or null if not ready. + */ + public static function info(mixed $data, string $label = 'Info'): ?Entry + { + if (!self::isReady()) { + return null; + } + + if (self::$client === null || self::$config === null) { + return null; + } + + $entry = new Entry(self::$client, self::$config->getSession(), self::$requestId, $data, $label); + return $entry->type('info')->color('gray'); + } + + /** + * Sends a debug-level message to the dashboard. + * + * Debug level indicates detailed diagnostic information. + * Displayed with purple color and "debug" type in the dashboard. + * + * @param mixed $data The data to debug. + * @param string $label Optional label for categorization. + * + * @return Entry|null The created entry, or null if not ready. + */ + public static function debug(mixed $data, string $label = 'Debug'): ?Entry + { + if (!self::isReady()) { + return null; + } + + if (self::$client === null || self::$config === null) { + return null; + } + + $entry = new Entry(self::$client, self::$config->getSession(), self::$requestId, $data, $label); + return $entry->type('debug')->color('purple'); + } + /** * Sends a toolbar metric to the dashboard. * From f2f097fcee21f3f3a82eefabbcee6d29c78cbc01 Mon Sep 17 00:00:00 2001 From: Leon Schmidt Date: Mon, 13 Apr 2026 19:11:42 +0200 Subject: [PATCH 3/3] Add version property and getter method to Config class --- src/Config.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Config.php b/src/Config.php index a25e1d6..7ed2f11 100644 --- a/src/Config.php +++ b/src/Config.php @@ -29,6 +29,11 @@ */ final class Config { + /** + * The current version of the DebugPHP client library. + */ + private string $version = '1.1.0'; + /** * The DebugPHP server URL. */ @@ -120,4 +125,15 @@ public function getEndpoint(string $path): string { return rtrim($this->host, '/') . '/' . ltrim($path, '/'); } + + /** + * Returns the current version of the DebugPHP client library. + * This can be used for debugging and compatibility checks. + * + * @return string The client library version. + */ + public function getVersion(): string + { + return $this->version; + } }