Enable Discovery debug logging for production troubleshooting

- Add DISCOVERY_LOG_LEVEL=debug
- Add DISCOVERY_SHOW_PROGRESS=true
- Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
2025-08-11 20:13:26 +02:00
parent 59fd3dd3b1
commit 55a330b223
3683 changed files with 2956207 additions and 16948 deletions

View File

@@ -29,7 +29,7 @@ final class Debugger
*/
public static function dump(mixed $data, string $label = '', bool $die = false): void
{
if (!self::isEnabled()) {
if (! self::isEnabled()) {
return;
}
@@ -56,7 +56,7 @@ final class Debugger
*/
public static function dumpArray(array $data, string $label = 'Array Debug'): void
{
if (!self::isEnabled()) {
if (! self::isEnabled()) {
return;
}
@@ -80,7 +80,7 @@ final class Debugger
*/
public static function dumpObject(object $object, string $label = ''): void
{
if (!self::isEnabled()) {
if (! self::isEnabled()) {
return;
}
@@ -90,9 +90,9 @@ final class Debugger
$objectInfo = [
'class' => $reflection->getName(),
'methods' => array_map(fn($method) => $method->getName(), $reflection->getMethods()),
'properties' => array_map(fn($prop) => $prop->getName(), $reflection->getProperties()),
'data' => $object
'methods' => array_map(fn ($method) => $method->getName(), $reflection->getMethods()),
'properties' => array_map(fn ($prop) => $prop->getName(), $reflection->getProperties()),
'data' => $object,
];
$debugInfo = new DebugEntry(
@@ -112,7 +112,7 @@ final class Debugger
*/
public static function log(string $message, string $level = 'DEBUG'): void
{
if (!self::isEnabled()) {
if (! self::isEnabled()) {
return;
}
@@ -136,7 +136,7 @@ final class Debugger
*/
public static function showHistory(): void
{
if (!self::isEnabled()) {
if (! self::isEnabled()) {
return;
}
@@ -144,6 +144,7 @@ final class Debugger
if (empty($entries)) {
self::getOutput()->outputRaw("Keine Debug-Historie vorhanden.\n");
return;
}

View File

@@ -4,7 +4,6 @@ declare(strict_types=1);
namespace App\Framework\Debug\Formatters;
use App\Framework\Console\ConsoleColor;
use App\Framework\Debug\DebugEntry;
use App\Framework\Debug\EntryType;
@@ -14,14 +13,14 @@ use App\Framework\Debug\EntryType;
final class ConsoleFormatter implements FormatterInterface
{
/** Farbdefinitionen für die Konsole */
private const RESET = ConsoleColor::YELLOW->value; # "\033[0m";
private const BOLD = "\033[1m";
private const GREEN = ConsoleColor::YELLOW->value; # "\033[32m";
private const string YELLOW = ConsoleColor::YELLOW->value; # "\033[33m";
private const string BLUE = ConsoleColor::BLUE->value; # "\033[34m";
private const string MAGENTA = ConsoleColor::MAGENTA->value; # "\033[35m";
private const string CYAN = ConsoleColor::CYAN->value; # "\033[36m";
private const string GRAY = ConsoleColor::GRAY->value; # = "\033[90m";
private const string RESET = "\033[0m";
private const string BOLD = "\033[1m";
private const string GREEN = "\033[32m";
private const string YELLOW = "\033[33m";
private const string BLUE = "\033[34m";
private const string MAGENTA = "\033[35m";
private const string CYAN = "\033[36m";
private const string GRAY = "\033[90m";
/**
* {@inheritdoc}
@@ -39,7 +38,7 @@ final class ConsoleFormatter implements FormatterInterface
if ($entry->getType() === EntryType::ARRAY && is_array($entry->getData())) {
$data = $entry->getData();
$output .= self::BLUE . "Elements: " . self::RESET . count($data);
if (!empty($data)) {
if (! empty($data)) {
$output .= " | " . self::BLUE . "Keys: " . self::RESET;
$output .= implode(', ', array_map('strval', array_keys($data)));
}
@@ -84,7 +83,7 @@ final class ConsoleFormatter implements FormatterInterface
// Hervorhebung von Schlüsseln in Arrays
$formatted = preg_replace(
'/\[(.*?)\]/',
'/\[(.*?)]/',
'[' . self::CYAN . '$1' . self::RESET . ']',
$formatted
);

View File

@@ -39,7 +39,7 @@ final class HtmlFormatter implements FormatterInterface
$data = $entry->getData();
$html .= '<div class="debug-array-info">';
$html .= '<small>Anzahl Elemente: ' . count($data) . '</small>';
if (!empty($data)) {
if (! empty($data)) {
$html .= '<small> | Schlüssel: ' . htmlspecialchars(implode(', ', array_map('strval', array_keys($data)))) . '</small>';
}
$html .= '</div>';

View File

@@ -4,7 +4,7 @@ declare(strict_types=1);
use App\Framework\Debug\Debugger;
if (!function_exists('dd')) {
if (! function_exists('dd')) {
/**
* Debug und beende (dump and die)
*/
@@ -14,7 +14,7 @@ if (!function_exists('dd')) {
}
}
if (!function_exists('debug')) {
if (! function_exists('debug')) {
/**
* Debug ohne beenden
*/
@@ -24,7 +24,7 @@ if (!function_exists('debug')) {
}
}
if (!function_exists('debug_array')) {
if (! function_exists('debug_array')) {
/**
* Debug speziell für Arrays
*/
@@ -34,7 +34,7 @@ if (!function_exists('debug_array')) {
}
}
if (!function_exists('debug_object')) {
if (! function_exists('debug_object')) {
/**
* Debug speziell für Objekte
*/
@@ -44,7 +44,7 @@ if (!function_exists('debug_object')) {
}
}
if (!function_exists('debug_log')) {
if (! function_exists('debug_log')) {
/**
* Einfaches Debug-Logging
*/
@@ -54,7 +54,7 @@ if (!function_exists('debug_log')) {
}
}
if (!function_exists('debug_history')) {
if (! function_exists('debug_history')) {
/**
* Debug-Historie anzeigen
*/