You are here

private function XMLSitemapTestHelper::formatWatchdogMessage in XML sitemap 7.2

Same name and namespace in other branches
  1. 6.2 xmlsitemap.test \XMLSitemapTestHelper::formatWatchdogMessage()

Format a watchdog message in a one-line summary.

Parameters

object $message: A watchdog message object.

Return value

string A string containing the watchdog message's timestamp, severity, type, and actual message.

1 call to XMLSitemapTestHelper::formatWatchdogMessage()
XMLSitemapTestHelper::assertNoWatchdogErrors in ./xmlsitemap.test
Check that there were no watchdog errors or worse.

File

./xmlsitemap.test, line 394
Unit tests for the xmlsitemap.

Class

XMLSitemapTestHelper
Helper test class with some added functions for testing.

Code

private function formatWatchdogMessage(stdClass $message) {
  static $levels;
  if (!isset($levels)) {
    module_load_include('admin.inc', 'dblog');
    $levels = watchdog_severity_levels();
  }
  return t('@timestamp - @severity - @type - !message', array(
    '@timestamp' => $message->timestamp,
    '@severity' => $levels[$message->severity],
    '@type' => $message->type,
    '!message' => theme_dblog_message(array(
      'event' => $message,
      'link' => FALSE,
    )),
  ));
}