From ccc405df4113d5e0e553d5485c46f87405703b89 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Sat, 25 Nov 2023 09:46:02 +0700 Subject: [PATCH] Deprecate `logQuery()` and use `$this->logger?->info()` --- src/Driver/Pdo/AbstractPdoCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Driver/Pdo/AbstractPdoCommand.php b/src/Driver/Pdo/AbstractPdoCommand.php index dffe0b794..db55998fb 100644 --- a/src/Driver/Pdo/AbstractPdoCommand.php +++ b/src/Driver/Pdo/AbstractPdoCommand.php @@ -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 { @@ -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());