|
@@ -15,12 +15,12 @@ trait LoggerTrait
|
|
/**
|
|
/**
|
|
* System is unusable.
|
|
* System is unusable.
|
|
*
|
|
*
|
|
- * @param string $message
|
|
|
|
|
|
+ * @param string|\Stringable $message
|
|
* @param array $context
|
|
* @param array $context
|
|
*
|
|
*
|
|
* @return void
|
|
* @return void
|
|
*/
|
|
*/
|
|
- public function emergency($message, array $context = array())
|
|
|
|
|
|
+ public function emergency(string|\Stringable $message, array $context = []): void
|
|
{
|
|
{
|
|
$this->log(LogLevel::EMERGENCY, $message, $context);
|
|
$this->log(LogLevel::EMERGENCY, $message, $context);
|
|
}
|
|
}
|
|
@@ -31,12 +31,12 @@ trait LoggerTrait
|
|
* Example: Entire website down, database unavailable, etc. This should
|
|
* Example: Entire website down, database unavailable, etc. This should
|
|
* trigger the SMS alerts and wake you up.
|
|
* trigger the SMS alerts and wake you up.
|
|
*
|
|
*
|
|
- * @param string $message
|
|
|
|
|
|
+ * @param string|\Stringable $message
|
|
* @param array $context
|
|
* @param array $context
|
|
*
|
|
*
|
|
* @return void
|
|
* @return void
|
|
*/
|
|
*/
|
|
- public function alert($message, array $context = array())
|
|
|
|
|
|
+ public function alert(string|\Stringable $message, array $context = []): void
|
|
{
|
|
{
|
|
$this->log(LogLevel::ALERT, $message, $context);
|
|
$this->log(LogLevel::ALERT, $message, $context);
|
|
}
|
|
}
|
|
@@ -46,12 +46,12 @@ trait LoggerTrait
|
|
*
|
|
*
|
|
* Example: Application component unavailable, unexpected exception.
|
|
* Example: Application component unavailable, unexpected exception.
|
|
*
|
|
*
|
|
- * @param string $message
|
|
|
|
|
|
+ * @param string|\Stringable $message
|
|
* @param array $context
|
|
* @param array $context
|
|
*
|
|
*
|
|
* @return void
|
|
* @return void
|
|
*/
|
|
*/
|
|
- public function critical($message, array $context = array())
|
|
|
|
|
|
+ public function critical(string|\Stringable $message, array $context = []): void
|
|
{
|
|
{
|
|
$this->log(LogLevel::CRITICAL, $message, $context);
|
|
$this->log(LogLevel::CRITICAL, $message, $context);
|
|
}
|
|
}
|
|
@@ -60,12 +60,12 @@ trait LoggerTrait
|
|
* Runtime errors that do not require immediate action but should typically
|
|
* Runtime errors that do not require immediate action but should typically
|
|
* be logged and monitored.
|
|
* be logged and monitored.
|
|
*
|
|
*
|
|
- * @param string $message
|
|
|
|
|
|
+ * @param string|\Stringable $message
|
|
* @param array $context
|
|
* @param array $context
|
|
*
|
|
*
|
|
* @return void
|
|
* @return void
|
|
*/
|
|
*/
|
|
- public function error($message, array $context = array())
|
|
|
|
|
|
+ public function error(string|\Stringable $message, array $context = []): void
|
|
{
|
|
{
|
|
$this->log(LogLevel::ERROR, $message, $context);
|
|
$this->log(LogLevel::ERROR, $message, $context);
|
|
}
|
|
}
|
|
@@ -76,12 +76,12 @@ trait LoggerTrait
|
|
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
|
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
|
* that are not necessarily wrong.
|
|
* that are not necessarily wrong.
|
|
*
|
|
*
|
|
- * @param string $message
|
|
|
|
|
|
+ * @param string|\Stringable $message
|
|
* @param array $context
|
|
* @param array $context
|
|
*
|
|
*
|
|
* @return void
|
|
* @return void
|
|
*/
|
|
*/
|
|
- public function warning($message, array $context = array())
|
|
|
|
|
|
+ public function warning(string|\Stringable $message, array $context = []): void
|
|
{
|
|
{
|
|
$this->log(LogLevel::WARNING, $message, $context);
|
|
$this->log(LogLevel::WARNING, $message, $context);
|
|
}
|
|
}
|
|
@@ -89,12 +89,12 @@ trait LoggerTrait
|
|
/**
|
|
/**
|
|
* Normal but significant events.
|
|
* Normal but significant events.
|
|
*
|
|
*
|
|
- * @param string $message
|
|
|
|
|
|
+ * @param string|\Stringable $message
|
|
* @param array $context
|
|
* @param array $context
|
|
*
|
|
*
|
|
* @return void
|
|
* @return void
|
|
*/
|
|
*/
|
|
- public function notice($message, array $context = array())
|
|
|
|
|
|
+ public function notice(string|\Stringable $message, array $context = []): void
|
|
{
|
|
{
|
|
$this->log(LogLevel::NOTICE, $message, $context);
|
|
$this->log(LogLevel::NOTICE, $message, $context);
|
|
}
|
|
}
|
|
@@ -104,12 +104,12 @@ trait LoggerTrait
|
|
*
|
|
*
|
|
* Example: User logs in, SQL logs.
|
|
* Example: User logs in, SQL logs.
|
|
*
|
|
*
|
|
- * @param string $message
|
|
|
|
|
|
+ * @param string|\Stringable $message
|
|
* @param array $context
|
|
* @param array $context
|
|
*
|
|
*
|
|
* @return void
|
|
* @return void
|
|
*/
|
|
*/
|
|
- public function info($message, array $context = array())
|
|
|
|
|
|
+ public function info(string|\Stringable $message, array $context = []): void
|
|
{
|
|
{
|
|
$this->log(LogLevel::INFO, $message, $context);
|
|
$this->log(LogLevel::INFO, $message, $context);
|
|
}
|
|
}
|
|
@@ -117,12 +117,12 @@ trait LoggerTrait
|
|
/**
|
|
/**
|
|
* Detailed debug information.
|
|
* Detailed debug information.
|
|
*
|
|
*
|
|
- * @param string $message
|
|
|
|
|
|
+ * @param string|\Stringable $message
|
|
* @param array $context
|
|
* @param array $context
|
|
*
|
|
*
|
|
* @return void
|
|
* @return void
|
|
*/
|
|
*/
|
|
- public function debug($message, array $context = array())
|
|
|
|
|
|
+ public function debug(string|\Stringable $message, array $context = []): void
|
|
{
|
|
{
|
|
$this->log(LogLevel::DEBUG, $message, $context);
|
|
$this->log(LogLevel::DEBUG, $message, $context);
|
|
}
|
|
}
|
|
@@ -131,12 +131,12 @@ trait LoggerTrait
|
|
* Logs with an arbitrary level.
|
|
* Logs with an arbitrary level.
|
|
*
|
|
*
|
|
* @param mixed $level
|
|
* @param mixed $level
|
|
- * @param string $message
|
|
|
|
|
|
+ * @param string|\Stringable $message
|
|
* @param array $context
|
|
* @param array $context
|
|
*
|
|
*
|
|
* @return void
|
|
* @return void
|
|
*
|
|
*
|
|
* @throws \Psr\Log\InvalidArgumentException
|
|
* @throws \Psr\Log\InvalidArgumentException
|
|
*/
|
|
*/
|
|
- abstract public function log($level, $message, array $context = array());
|
|
|
|
|
|
+ abstract public function log($level, string|\Stringable $message, array $context = []): void;
|
|
}
|
|
}
|