class NullLogger in Service Container 7
Same name and namespace in other branches
- 7.2 lib/Psr/Log/NullLogger.php \Psr\Log\NullLogger
This Logger can be used to avoid conditional log calls
Logging should always be optional, and if no logger is provided to your library creating a NullLogger instance to have something to throw logs at is a good way to avoid littering your code with `if ($this->logger) { }` blocks.
Hierarchy
- class \Psr\Log\AbstractLogger implements LoggerInterface
- class \Psr\Log\NullLogger
Expanded class hierarchy of NullLogger
File
- lib/
Psr/ Log/ NullLogger.php, line 13
Namespace
Psr\LogView source
class NullLogger extends AbstractLogger {
/**
* Logs with an arbitrary level.
*
* @param mixed $level
* @param string $message
* @param array $context
* @return null
*/
public function log($level, $message, array $context = array()) {
// noop
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AbstractLogger:: |
public | function |
Action must be taken immediately. Overrides LoggerInterface:: |
|
AbstractLogger:: |
public | function |
Critical conditions. Overrides LoggerInterface:: |
|
AbstractLogger:: |
public | function |
Detailed debug information. Overrides LoggerInterface:: |
|
AbstractLogger:: |
public | function |
System is unusable. Overrides LoggerInterface:: |
|
AbstractLogger:: |
public | function |
Runtime errors that do not require immediate action but should typically
be logged and monitored. Overrides LoggerInterface:: |
|
AbstractLogger:: |
public | function |
Interesting events. Overrides LoggerInterface:: |
|
AbstractLogger:: |
public | function |
Normal but significant events. Overrides LoggerInterface:: |
|
AbstractLogger:: |
public | function |
Exceptional occurrences that are not errors. Overrides LoggerInterface:: |
|
NullLogger:: |
public | function |
Logs with an arbitrary level. Overrides LoggerInterface:: |