You are here

public function AcquiaLiftTestLogger::log in Acquia Lift Connector 7.2

Same name and namespace in other branches
  1. 7 tests/acquia_lift.test_classes.inc \AcquiaLiftTestLogger::log()

File

tests/acquia_lift.test_classes.inc, line 206
Provides test classes for Acquia Lift

Class

AcquiaLiftTestLogger

Code

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,
  );
}