本文整理汇总了PHP中CLog::getmicrotime方法的典型用法代码示例。如果您正苦于以下问题:PHP CLog::getmicrotime方法的具体用法?PHP CLog::getmicrotime怎么用?PHP CLog::getmicrotime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLog
的用法示例。
在下文中一共展示了CLog::getmicrotime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _writeLine
/**
* @access private
* @param string $errorDesc
* @param int $line
*/
function _writeLine($errorDesc, $line)
{
static $_isFirst = true;
static $_lastTime;
if ($_isFirst) {
$_ftime = date('d/m/Y H:i:s');
$_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
$_isFirst = false;
$_post = isset($_POST) && count($_POST) > 0 ? ' [POST(' . count($_POST) . ')]' : '';
@error_log("\r\n" . '[' . $_ftime . '] URL ' . $_uri . $_post . "\r\n", 3, $this->LogFilePath);
$_server = isset($_SERVER['SERVER_SOFTWARE']) ? ', ' . $_SERVER['SERVER_SOFTWARE'] : '';
@error_log('[' . $_ftime . '] INFO > ver.' . WMVERSION . ', PHP-' . phpversion() . $_server . "\r\n", 3, $this->LogFilePath);
if (strlen($_post) > 0) {
@error_log('[' . $_ftime . '] POST > [' . implode(', ', array_keys($_POST)) . "]\r\n", 3, $this->LogFilePath);
}
}
if (LOG_LINELIMIT && strlen($errorDesc) > LOG_LINELIMIT * 2) {
$errorDesc = substr($errorDesc, 0, LOG_LINELIMIT) . "\r\n ----------- cut ------------ \r\n" . substr($errorDesc, -(int) ceil(LOG_LINELIMIT / 2));
}
$line = strlen($line) > 0 ? '[line: ' . $line . ']' : '';
$_newTime = CLog::getmicrotime();
$_newSTime = (int) (CLog::getmicrosec() * 1000);
$_tmpTime = (int) (($_newTime - $_lastTime) * 1000);
$_pref = '';
if ($_lastTime && $_tmpTime > LOG_TIMERUN) {
$_pref = $_tmpTime . '::';
}
$_lastTime = $_newTime;
@error_log($_pref . '[' . date('H:i:s', $_newTime) . '.' . $_newSTime . ']' . $line . ' ' . $errorDesc . "\r\n", 3, $this->LogFilePath);
}