class AcquiaLiftTestLogger in Acquia Lift Connector 7
Same name and namespace in other branches
- 7.2 tests/acquia_lift.test_classes.inc \AcquiaLiftTestLogger
Hierarchy
- class \AcquiaLiftTestLogger implements \PersonalizeLoggerInterface
Expanded class hierarchy of AcquiaLiftTestLogger
File
- tests/
acquia_lift.test_classes.inc, line 292 - Provides test classes for Acquia Lift
View source
class AcquiaLiftTestLogger implements PersonalizeLoggerInterface {
protected static $logs = array();
protected $output = FALSE;
public function __construct($output = FALSE) {
$this->output = $output;
}
public function log($level, $message, array $context = array()) {
foreach ($context as $key => $value) {
if (strpos($message, '{' . $key . '}') !== FALSE) {
$message = str_replace('{' . $key . '}', $value, $message);
}
}
if ($this->output && function_exists('drupal_set_message')) {
drupal_set_message($message, $level);
}
self::$logs[] = array(
'level' => $level,
'message' => $message,
);
}
public function clearLogs() {
self::$logs = array();
}
public function getLogs() {
return self::$logs;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AcquiaLiftTestLogger:: |
protected static | property | ||
AcquiaLiftTestLogger:: |
protected | property | ||
AcquiaLiftTestLogger:: |
public | function | ||
AcquiaLiftTestLogger:: |
public | function | ||
AcquiaLiftTestLogger:: |
public | function | ||
AcquiaLiftTestLogger:: |
public | function |