gy-doc-code
[ class tree: gy-doc-code ] [ index: gy-doc-code ] [ all elements ]

Source for file AbstractLogger.php

Documentation is available at AbstractLogger.php

  1. <?php
  2.  
  3. namespace Psr\Log;
  4.  
  5. /**
  6.  * AbstractLogger - реализация LoggerInterface
  7.  */
  8. abstract class AbstractLogger implements LoggerInterface
  9. {
  10.     /**
  11.      * Система не работает
  12.      *
  13.      * @param string $message 
  14.      * @param array $context 
  15.      * @return void 
  16.      */
  17.     public function emergency($message, array $context = array())
  18.     {
  19.         $this->log(LogLevel::EMERGENCY, $message, $context);
  20.     }
  21.  
  22.     /**
  23.      * Требуется немедленные действия
  24.      *
  25.      * @param string $message 
  26.      * @param array $context 
  27.      * @return void 
  28.      */
  29.     public function alert($message, array $context = array())
  30.     {
  31.         $this->log(LogLevel::ALERT, $message, $context);
  32.     }
  33.  
  34.     /**
  35.      * Критическая ситуация.
  36.      *
  37.      * @param string $message 
  38.      * @param array $context 
  39.      * @return void 
  40.      */
  41.     public function critical($message, array $context = array())
  42.     {
  43.         $this->log(LogLevel::CRITICAL, $message, $context);
  44.     }
  45.  
  46.     /**
  47.      * Ошибка на стадии выполнения, не требующая немедленных действий,
  48.      * но требующая быть залогированной и дальнейшего изучения
  49.      *
  50.      * @param string $message 
  51.      * @param array $context 
  52.      * @return void 
  53.      */
  54.     public function error($message, array $context = array())
  55.     {
  56.         $this->log(LogLevel::ERROR, $message, $context);
  57.     }
  58.  
  59.     /**
  60.      * Исключительные случаи, которые не являются ошибками
  61.  
  62.      * @param string $message 
  63.      * @param array $context 
  64.      * @return void 
  65.      */
  66.     public function warning($message, array $context = array())
  67.     {
  68.         $this->log(LogLevel::WARNING, $message, $context);
  69.     }
  70.  
  71.     /**
  72.      * Нормальные события в работе приложения, но значимые и требуют логирования
  73.      *
  74.      * @param string $message 
  75.      * @param array $context 
  76.      * @return void 
  77.      */
  78.     public function notice($message, array $context = array())
  79.     {
  80.         $this->log(LogLevel::NOTICE, $message, $context);
  81.     }
  82.  
  83.     /**
  84.      * Полезные значимые события
  85.      *
  86.      * @param string $message 
  87.      * @param array $context 
  88.      * @return void 
  89.      */
  90.     public function info($message, array $context = array())
  91.     {
  92.         $this->log(LogLevel::INFO, $message, $context);
  93.     }
  94.  
  95.     /**
  96.      * Подробная отладочная информация
  97.      *
  98.      * @param string $message 
  99.      * @param array $context 
  100.      * @return void 
  101.      */
  102.     public function debug($message, array $context = array())
  103.     {
  104.         $this->log(LogLevel::DEBUG, $message, $context);
  105.     }
  106. }

Documentation generated on Sat, 27 Apr 2024 11:17:28 +0300 by phpDocumentor 1.4.3