8
0

allow newlines in cli output, add FirePHP handler to browser console log

Dieser Commit ist enthalten in:
Daniel Seifert 2019-09-20 22:30:27 +02:00
Ursprung bd16bf36cd
Commit d21a3f892d
2 geänderte Dateien mit 18 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -5,7 +5,7 @@ require __DIR__ . '/../../../../source/bootstrap.php';
\D3StartSQLLog('Query for 100 items cheaper than 49,99');
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$list = $db->getAll('SELECT * FROM oxarticles WHERE oxprice < ? LIMIT 100', [49.99]);
$list = $db->getAll('SELECT * '.PHP_EOL.'FROM oxarticles WHERE oxprice < ? LIMIT 100', [49.99]);
\D3StopSQLLog();

Datei anzeigen

@ -34,6 +34,7 @@ class LoggerFactory
$handlers[] = $this->getStreamHandler();
} else {
$handlers[] = $this->getBrowserConsoleHandler();
$handlers[] = $this->getFirePHPHandler();
}
return $handlers;
}
@ -53,7 +54,14 @@ class LoggerFactory
$ttl_color = "$channel $level_name: $message {$newline} $context {$newline} %extra%" . PHP_EOL;
$streamHandler->setFormatter(new Monolog\Formatter\LineFormatter($ttl_color));
$streamHandler->setFormatter(
new Monolog\Formatter\LineFormatter(
$ttl_color,
null,
true,
true
)
);
return $streamHandler;
}
@ -66,6 +74,14 @@ class LoggerFactory
return new Monolog\Handler\BrowserConsoleHandler();
}
/**
* @return Monolog\Handler\FirePHPHandler
*/
private function getFirePHPHandler()
{
return new Monolog\Handler\FirePHPHandler();
}
/**
* @return array
*/