本文整理汇总了PHP中eZDebug::showMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP eZDebug::showMessage方法的具体用法?PHP eZDebug::showMessage怎么用?PHP eZDebug::showMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZDebug
的用法示例。
在下文中一共展示了eZDebug::showMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addTimingPoint
static function addTimingPoint($description = "")
{
if (!eZDebug::isDebugEnabled()) {
return;
}
if (!eZDebug::showMessage(self::SHOW_TIMING_POINT)) {
return;
}
$time = microtime(true);
$debug = eZDebug::instance();
$usedMemory = 0;
if (function_exists("memory_get_usage")) {
$usedMemory = memory_get_usage();
}
$tp = array("Time" => $time, "Description" => $description, "MemoryUsage" => $usedMemory);
$debug->TimePoints[] = $tp;
$desc = "Timing Point: {$description}";
foreach (array(self::LEVEL_NOTICE, self::LEVEL_WARNING, self::LEVEL_ERROR, self::LEVEL_DEBUG, self::LEVEL_STRICT) as $lvl) {
if (isset($debug->TmpTimePoints[$lvl])) {
$debug->TmpTimePoints[$lvl] = array();
}
if ($debug->TmpTimePoints[$lvl] === false and $debug->isLogFileEnabled($lvl)) {
$files = $debug->logFiles();
$file = $files[$lvl];
$debug->writeFile($file, $desc, $lvl);
} else {
array_push($debug->TmpTimePoints[$lvl], $tp);
}
}
$debug->write($description, self::LEVEL_TIMING_POINT);
}