class StashLogger in Backup and Migrate 5.0.x
Saves log entries to memory to be processed during the current process.
This simple service does no clearing or memory management so should not be used for a long-running process.
@package Drupal\backup_migrate\Core\Service
Hierarchy
- class \Drupal\backup_migrate\Core\Service\StashLogger extends \Psr\Log\AbstractLogger
Expanded class hierarchy of StashLogger
1 file declares its use of StashLogger
- Notify.php in src/
Core/ Filter/ Notify.php
File
- src/
Core/ Service/ StashLogger.php, line 15
Namespace
Drupal\backup_migrate\Core\ServiceView source
class StashLogger extends AbstractLogger {
/**
* @var array
*/
protected $logs = [];
/**
* Logs with an arbitrary level.
*
* @param mixed $level
* @param string $message
* @param array $context
*/
public function log($level, $message, array $context = []) {
$this->logs[] = [
'level' => $level,
'message' => $message,
'context' => $context,
];
}
/**
* Get all of the log messages that were saved to this stash.
*
* @return array
*/
public function getAll() {
return $this->logs;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
StashLogger:: |
protected | property | ||
StashLogger:: |
public | function | Get all of the log messages that were saved to this stash. | |
StashLogger:: |
public | function | Logs with an arbitrary level. |