Skip to content

Commit

Permalink
Deprecate logQuery() and use $this->logger?->info()
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Nov 25, 2023
1 parent 5136e62 commit ccc405d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Driver/Pdo/AbstractPdoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ protected function internalGetQueryResult(int $queryMode): mixed

/**
* Logs the current database query if query logging is on and returns the profiling token if profiling is on.
*
* @deprecated Use {@see logger} instead. Will be removed in version 2.0.0.
*/
protected function logQuery(string $rawSql, string $category): void
{
Expand All @@ -267,7 +269,7 @@ protected function queryInternal(int $queryMode): mixed
{
$logCategory = self::class . '::' . $this->getQueryMode($queryMode);

$this->logger?->log(LogLevel::INFO, $rawSql = $this->getRawSql(), [$logCategory]);
$this->logger?->info($rawSql = $this->getRawSql(), [$logCategory]);

$queryContext = new CommandContext(__METHOD__, $logCategory, $this->getSql(), $this->getParams());

Expand Down

0 comments on commit ccc405d

Please sign in to comment.