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:
33
tests/debug/debug-capacities.php
Normal file
33
tests/debug/debug-capacities.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
use App\Framework\QrCode\ErrorCorrectionLevel;
|
||||
use App\Framework\QrCode\QrCodeVersion;
|
||||
use App\Framework\QrCode\ReedSolomon\ReedSolomonEncoder;
|
||||
|
||||
echo "=== Capacity Comparison ===\n\n";
|
||||
|
||||
for ($version = 1; $version <= 5; $version++) {
|
||||
$qrVersion = new QrCodeVersion($version);
|
||||
|
||||
echo "Version $version:\n";
|
||||
|
||||
foreach ([ErrorCorrectionLevel::L, ErrorCorrectionLevel::M] as $errorLevel) {
|
||||
$qrCapacity = $qrVersion->getDataCapacity($errorLevel);
|
||||
$rsCapacity = ReedSolomonEncoder::getDataCapacity($version, $errorLevel->value);
|
||||
|
||||
echo " {$errorLevel->value}: QrCodeVersion={$qrCapacity} bits (" . ($qrCapacity / 8) . " bytes), ";
|
||||
echo "ReedSolomon={$rsCapacity} codewords\n";
|
||||
|
||||
// Check if they match when converted
|
||||
if (($qrCapacity / 8) != $rsCapacity) {
|
||||
echo " ❌ MISMATCH: " . ($qrCapacity / 8) . " bytes vs $rsCapacity codewords\n";
|
||||
} else {
|
||||
echo " ✅ MATCH\n";
|
||||
}
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
Reference in New Issue
Block a user