NF_Abstracts_Logger

This is a simple Logger implementation that other Loggers can inherit from.

Defined (1)

The class is defined in the following location(s).

/includes/Abstracts/Logger.php  
  1. abstract class NF_Abstracts_Logger implements LoggerInterface 
  2. /** 
  3. * System is unusable. 
  4. * @param string $message 
  5. * @param array $context 
  6. * @return null 
  7. */ 
  8. public function emergency($message, array $context = array()) 
  9. $this->log(LogLevel::EMERGENCY, $message, $context); 
  10.  
  11. /** 
  12. * Action must be taken immediately. 
  13. * Example: Entire website down, database unavailable, etc. This should 
  14. * trigger the SMS alerts and wake you up. 
  15. * @param string $message 
  16. * @param array $context 
  17. * @return null 
  18. */ 
  19. public function alert($message, array $context = array()) 
  20. $this->log(LogLevel::ALERT, $message, $context); 
  21.  
  22. /** 
  23. * Critical conditions. 
  24. * Example: Application component unavailable, unexpected exception. 
  25. * @param string $message 
  26. * @param array $context 
  27. * @return null 
  28. */ 
  29. public function critical($message, array $context = array()) 
  30. $this->log(LogLevel::CRITICAL, $message, $context); 
  31.  
  32. /** 
  33. * Runtime errors that do not require immediate action but should typically 
  34. * be logged and monitored. 
  35. * @param string $message 
  36. * @param array $context 
  37. * @return null 
  38. */ 
  39. public function error($message, array $context = array()) 
  40. $this->log(LogLevel::ERROR, $message, $context); 
  41.  
  42. /** 
  43. * Exceptional occurrences that are not errors. 
  44. * Example: Use of deprecated APIs, poor use of an API, undesirable things 
  45. * that are not necessarily wrong. 
  46. * @param string $message 
  47. * @param array $context 
  48. * @return null 
  49. */ 
  50. public function warning($message, array $context = array()) 
  51. $this->log(LogLevel::WARNING, $message, $context); 
  52.  
  53. /** 
  54. * Normal but significant events. 
  55. * @param string $message 
  56. * @param array $context 
  57. * @return null 
  58. */ 
  59. public function notice($message, array $context = array()) 
  60. $this->log(LogLevel::NOTICE, $message, $context); 
  61.  
  62. /** 
  63. * Interesting events. 
  64. * Example: User logs in, SQL logs. 
  65. * @param string $message 
  66. * @param array $context 
  67. * @return null 
  68. */ 
  69. public function info($message, array $context = array()) 
  70. $this->log(LogLevel::INFO, $message, $context); 
  71.  
  72. /** 
  73. * Detailed debug information. 
  74. * @param string $message 
  75. * @param array $context 
  76. * @return null 
  77. */ 
  78. public function debug($message, array $context = array()) 
  79. $this->log(LogLevel::DEBUG, $message, $context);