<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
use Friendica\Core\Logger\Exception\LoggerArgumentException;
use Friendica\Core\Logger\Exception\LoggerException;
+use Friendica\Core\Logger\Exception\LogLevelException;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\FileSystem;
-use Friendica\Util\Introspection;
+use Friendica\Core\Logger\Util\Introspection;
use Psr\Log\LogLevel;
/**
* @param string $level The minimum loglevel at which this logger will be triggered
*
* @throws LoggerArgumentException
+ * @throws LogLevelException
*/
public function __construct($channel, $stream, Introspection $introspection, FileSystem $fileSystem, string $level = LogLevel::DEBUG)
{
if (array_key_exists($level, $this->levelToInt)) {
$this->logLevel = $this->levelToInt[$level];
} else {
- throw new LoggerArgumentException(sprintf('The level "%s" is not valid.', $level));
+ throw new LogLevelException(sprintf('The level "%s" is not valid.', $level));
}
$this->checkStream();
* @return void
*
* @throws LoggerException
- * @throws LoggerArgumentException
+ * @throws LogLevelException
*/
protected function addEntry($level, string $message, array $context = [])
{
if (!array_key_exists($level, $this->levelToInt)) {
- throw new LoggerArgumentException(sprintf('The level "%s" is not valid.', $level));
+ throw new LogLevelException(sprintf('The level "%s" is not valid.', $level));
}
$logLevel = $this->levelToInt[$level];