本文整理汇总了PHP中Nette\Diagnostics\Debugger::fireLog方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugger::fireLog方法的具体用法?PHP Debugger::fireLog怎么用?PHP Debugger::fireLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Diagnostics\Debugger
的用法示例。
在下文中一共展示了Debugger::fireLog方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: log_write
function log_write($data, FileDownload $file, IDownloader $downloader)
{
$cache = Environment::getCache("FileDownloader/log");
$log = array();
$tid = (string) $file->getTransferId();
if (!isset($cache["registry"])) {
$cache["registry"] = array();
}
$reg = $cache["registry"];
$reg[$tid] = true;
$cache["registry"] = $reg;
if (isset($cache[$tid])) {
$log = $cache[$tid];
}
Debugger::fireLog("Data: " . $data . "; " . $downloader->end);
$data = $data . ": " . Helpers::bytes($file->transferredBytes) . " <->; ";
if ($downloader instanceof AdvancedDownloader and $downloader->isInitialized()) {
$data .= "position: " . Helpers::bytes($downloader->position) . "; ";
//$data .= "length: ".Helpers::bytes($downloader->length)."; ";
$data .= "http-range: " . Helpers::bytes($downloader->start) . "-" . Helpers::bytes($downloader->end) . "; ";
$data .= "progress (con: " . round($file->transferredBytes / $downloader->end * 100) . "% X ";
$data .= "file: " . round($downloader->position / $file->sourceFileSize * 100) . "%)";
}
$log[] = $data;
$cache[$tid] = $log;
}
示例2: createComponentGrid
protected function createComponentGrid($name)
{
$grid = new \Gridder\Gridder($this, $name);
$grid->setTranslator($this->context->translator);
$persister = new \Gridder\Persisters\SessionPersister($this->getSession('gridder'));
$grid->setPersister($persister);
$array = array();
$start = microtime();
for ($i = 1; $i <= 2000; $i++) {
$array[] = array('id' => (int) $i, 'name' => 'name' . $i);
}
$stop = microtime();
\Nette\Diagnostics\Debugger::fireLog($stop - $start);
$dataSource = new \Gridder\Sources\ArraySource($array);
$dataSource->setPrimaryKey('id');
$grid->setDataSource($dataSource);
$grid->addColumn('id')->setAlias('Idecko')->setFilter('text');
$grid->addColumn('name')->setFilter('text');
/*
$ac = $grid->addActionColumn('actions');
$ac->addAction('test', 'delete!');
$ac->addAction('test2', 'delete!');
$ac->addAction('test3', 'delete!');
*/
/*
$grid->addOperation('test', function($records){
$message = sprintf('You have selected %s records in method %s', count($records), __FUNCTION__);
$type = 'ok';
return new \Gridder\Message($message, $type);
})->setAlias('TEST');
$operation = new \Gridder\Operation('ohohoo');
$callback = callback($this, 'mehehe');
$operation->setAlias('BUBUBU')->setCallback($callback);
$grid->addOperation($operation);
*
*/
}
示例3: flog
function flog($message)
{
Debugger::fireLog($message);
}
示例4: f
function f($var)
{
\Nette\Diagnostics\Debugger::fireLog($var);
}