You are here

class AcquiaLiftTestLogger in Acquia Lift Connector 7

Same name and namespace in other branches
  1. 7.2 tests/acquia_lift.test_classes.inc \AcquiaLiftTestLogger

Hierarchy

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