function UnishTestCase::log

8.0.x UnishTestCase.php UnishTestCase::log($message, $type = 'notice')
7.x UnishTestCase.php UnishTestCase::log($message, $type = 'notice')
master UnishTestCase.php UnishTestCase::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 UnishTestCase::log()

File

tests/Unish/UnishTestCase.php, line 76

Namespace

Unish

Class

UnishTestCase

Code

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