trim leading whitespace when logging queries
This commit is contained in:
parent
1bd7e1a547
commit
eb885c443c
1 changed files with 1 additions and 0 deletions
|
@ -192,6 +192,7 @@ class Database
|
||||||
{
|
{
|
||||||
global $_tracer;
|
global $_tracer;
|
||||||
$dur = microtime(true) - $start;
|
$dur = microtime(true) - $start;
|
||||||
|
$query = trim(preg_replace('/^[\t ]+/m', '', $query)); // trim leading whitespace
|
||||||
$_tracer->complete($start * 1000000, $dur * 1000000, "DB Query", ["query"=>$query, "args"=>$args, "method"=>$method]);
|
$_tracer->complete($start * 1000000, $dur * 1000000, "DB Query", ["query"=>$query, "args"=>$args, "method"=>$method]);
|
||||||
$this->query_count++;
|
$this->query_count++;
|
||||||
$this->dbtime += $dur;
|
$this->dbtime += $dur;
|
||||||
|
|
Reference in a new issue