Skip to content

Commit

Permalink
fix(logging): adjust method signature to match flow5 version of paren…
Browse files Browse the repository at this point in the history
…t class
  • Loading branch information
das-nagnag committed Jun 12, 2024
1 parent 2c15660 commit 2379e51
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions Classes/Backend/JSONConsoleLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace t3n\FlowLog\Backend;

use Google\Cloud\BigQuery\Date;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Log\Backend\ConsoleBackend;

Expand Down Expand Up @@ -33,16 +32,25 @@ public function open(): void
}

/**
* Appends the given message along with the additional information into the log.
*
* @param string $message The message to log
* @param integer $severity One of the LOG_* constants
* @param mixed $additionalData A variable containing more information about the event to be logged
* @param string $packageKey Key of the package triggering the log (determined automatically if not specified)
* @param string $className Name of the class triggering the log (determined automatically if not specified)
* @param string $methodName Name of the method triggering the log (determined automatically if not specified)
* @return void
* @api
*/
public function append(
string $message,
int $severity = LOG_INFO,
$message,
$severity = LOG_INFO,
$additionalData = null,
?string $packageKey = null,
?string $className = null,
?string $methodName = null
): void {
$packageKey = null,
$className = null,
$methodName = null
) {
if ($severity > $this->severityThreshold) {
return;
}
Expand All @@ -69,7 +77,7 @@ public function append(
'version' => $this->serviceContext['version'],
'message' => $message,
'additionalData' => json_encode($additionalData, JSON_THROW_ON_ERROR),
'date' => new Date(new \DateTime('now')),
'date' => (new \DateTime('now'))->format('Y-m-d'),
'datetime' => new \DateTime('now')
];
$output = json_encode($data);
Expand All @@ -86,7 +94,7 @@ public function append(
],
'stackTrace' => $e->getTraceAsString()
],
'date' => new Date(new \DateTime('now')),
'date' => (new \DateTime('now'))->format('Y-m-d'),
'datetime' => new \DateTime('now')
];
$output = json_encode($data);
Expand Down

0 comments on commit 2379e51

Please sign in to comment.