https://github.com/minicli/minicli/blob/main/src/Logging/Logger.php#L38
public function log(string $message, array $context = [], LogLevel $level = null): void
{
$level ??= $this->logLevel;
$this->writeLog(sprintf(
"[%s] %s: %s%s\n",
date($this->timestampFormat),
$level->value,
$message,
[] === $context ? '' : ' - '.json_encode($context)
));
}
I found this issue when upgrading from PHP 8.3 to 8.4.
Changing the method to:
public function log(string $message, array $context = [], ?LogLevel $level = null): void
{
$level ??= $this->logLevel;
$this->writeLog(sprintf(
"[%s] %s: %s%s\n",
date($this->timestampFormat),
$level->value,
$message,
[] === $context ? '' : ' - '.json_encode($context)
));
}
Seems to be working.
In addition, you need to have updated dependencies defined in composer.json.
Is this a submittable change?