Debug
It is possible to attach to Client any PSR-3 Logger to obtain all queries performed, using the setLogger()
method.
class BasicLogger extends \Psr\Log\AbstractLogger
{
public function log($level, \Stringable|string $message, array $context = []): void
{
echo $message . "\n";
}
}
$client->setLogger(new BasicLogger());
Plus, SPARQLer includes a DebugBar custom Data Collector to collect and display all executed SPARQL queries directly in your web page.
To enable it, just call the enableDebugBar()
method of a Client and pass your instance of DebugBar.
use DebugBar\StandardDebugBar;
$debugbar = new StandardDebugBar();
$client->enableDebugBar($debugbar);