function Drush_TestCase::log

6.x drush_testcase.inc Drush_TestCase::log($message, $type = 'notice')
5.x drush_testcase.inc Drush_TestCase::log($message, $type = 'notice')

Print a log message to the console.

Parameters

string $message:

string $type: Supported types are:

  • notice
  • verbose
  • debug
3 calls to Drush_TestCase::log()
contextCase::setUpPaths in tests/contextTest.php
Drush_CommandTestCase::execute in tests/drush_testcase.inc
Actually runs the command. Does not trap the error stream output as this need PHP 4.3+.
Drush_TestCase::setUpDrupal in tests/drush_testcase.inc

File

tests/drush_testcase.inc, line 67
Initialize a sandboxed environment. Starts with call unish_init() at bottom.

Class

Drush_TestCase

Code

function log($message, $type = 'notice') {
  $line = "\nLog: $message\n";
  switch ($this->log_level()) {
    case 'verbose':
      if (in_array($type, array('notice', 'verbose'))) {
        print $line;
      }
      break;
    case 'debug':
      print $line;
      break;
    default:
      if ($type == 'notice') {
        print $line;
      }
      break;
  }
}