Skip to content

Commit

Permalink
FileLogger: fixed object to string conversion with custom driver (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miloslav Hůla committed Sep 24, 2020
1 parent ff1c9fa commit d78bb8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Dibi/Loggers/FileLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function logEvent(Dibi\Event $event): void
private function writeToFile(Dibi\Event $event, string $message): void
{
$message .=
"\n-- driver: " . $event->connection->getConfig('driver') . '/' . $event->connection->getConfig('name')
"\n-- driver: " . (is_object($driver = $event->connection->getConfig('driver')) ? get_class($driver) : $driver) . '/' . $event->connection->getConfig('name')
. "\n-- " . date('Y-m-d H:i:s')
. "\n\n";
file_put_contents($this->file, $message, FILE_APPEND | LOCK_EX);
Expand Down

0 comments on commit d78bb8f

Please sign in to comment.