Psr\Log\LoggerInterface::notice PHP Method

notice() public method

Normal but significant events.
public notice ( string $message, array $context = [] ) : null
$message string
$context array
return null
    public function notice($message, array $context = array());

Usage Example

Example #1
0
 /**
  * Error handler
  *
  * @param $errno
  * @param $errstr
  * @param $errfile
  * @param $errline
  */
 public function error($errno, $errstr, $errfile, $errline)
 {
     $message = $errstr . ' in ' . $errfile . ' on line ' . $errline;
     if (null !== $this->logger) {
         switch ($errno) {
             case E_CORE_ERROR:
             case E_COMPILE_ERROR:
             case E_COMPILE_WARNING:
                 $this->logger->emergency($message);
                 break;
             case E_ERROR:
             case E_USER_ERROR:
             case E_PARSE:
             case E_RECOVERABLE_ERROR:
                 $this->logger->error($message);
                 break;
             case E_WARNING:
             case E_USER_WARNING:
                 $this->logger->warning($message);
                 break;
             case E_NOTICE:
             case E_USER_NOTICE:
                 $this->logger->notice($message);
                 break;
             case E_DEPRECATED:
             case E_USER_DEPRECATED:
             case E_STRICT:
                 $this->logger->notice($message);
                 break;
             default:
                 $this->logger->error("Unknown error type: " . $errno . ": " . $message);
                 break;
         }
     }
 }
All Usage Examples Of Psr\Log\LoggerInterface::notice