Skip to content

Commit

Permalink
Fold AbstractLogger and LoggerTrait together.
Browse files Browse the repository at this point in the history
  • Loading branch information
Crell committed Jun 5, 2021
1 parent 91ef215 commit 957f465
Showing 1 changed file with 1 addition and 114 deletions.
115 changes: 1 addition & 114 deletions Psr/Log/AbstractLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,118 +11,5 @@
*/
abstract class AbstractLogger implements LoggerInterface
{
/**
* System is unusable.
*
* @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
public function emergency(string|\Stringable $message, array $context = [])
{
$this->log(LogLevel::EMERGENCY, $message, $context);
}

/**
* Action must be taken immediately.
*
* Example: Entire website down, database unavailable, etc. This should
* trigger the SMS alerts and wake you up.
*
* @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
public function alert(string|\Stringable $message, array $context = [])
{
$this->log(LogLevel::ALERT, $message, $context);
}

/**
* Critical conditions.
*
* Example: Application component unavailable, unexpected exception.
*
* @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
public function critical(string|\Stringable $message, array $context = [])
{
$this->log(LogLevel::CRITICAL, $message, $context);
}

/**
* Runtime errors that do not require immediate action but should typically
* be logged and monitored.
*
* @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
public function error(string|\Stringable $message, array $context = [])
{
$this->log(LogLevel::ERROR, $message, $context);
}

/**
* Exceptional occurrences that are not errors.
*
* Example: Use of deprecated APIs, poor use of an API, undesirable things
* that are not necessarily wrong.
*
* @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
public function warning(string|\Stringable $message, array $context = [])
{
$this->log(LogLevel::WARNING, $message, $context);
}

/**
* Normal but significant events.
*
* @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
public function notice(string|\Stringable $message, array $context = [])
{
$this->log(LogLevel::NOTICE, $message, $context);
}

/**
* Interesting events.
*
* Example: User logs in, SQL logs.
*
* @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
public function info(string|\Stringable $message, array $context = [])
{
$this->log(LogLevel::INFO, $message, $context);
}

/**
* Detailed debug information.
*
* @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
public function debug(string|\Stringable $message, array $context = [])
{
$this->log(LogLevel::DEBUG, $message, $context);
}
use LoggerTrait;
}

0 comments on commit 957f465

Please sign in to comment.