Exemplo n.º 1
0
Arquivo: Debug.php Projeto: xifat/zphp
 public static function end($key = 'ALL', $logName = 'debug')
 {
     $endTime = self::getMicroTime();
     $run_id = 0;
     if (self::$xhprof) {
         $xhprof_data = \xhprof_disable();
         $xhprof_runs = new \XHProfRuns_Default();
         $run_id = $xhprof_runs->save_run($xhprof_data, 'random');
     }
     $times = $endTime - self::$records[$key]['start_time'];
     $mem_use = memory_get_usage() - self::$records[$key]['memory_use'];
     unset(self::$records[$key]);
     Log::info($logName, array($times, self::convert($mem_use), $run_id, $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'], \json_encode($_REQUEST)));
 }
Exemplo n.º 2
0
 public static function end($key = 'ALL', $logName = 'debug')
 {
     $endTime = self::getMicroTime();
     $run_id = 0;
     if (self::$xhprof) {
         $xhprof_data = \xhprof_disable();
         $xhprof_runs = new \XHProfRuns_Default();
         $run_id = $xhprof_runs->save_run($xhprof_data, 'random');
     }
     $times = $endTime - self::$records[$key]['start_time'];
     $mem_use = memory_get_usage() - self::$records[$key]['memory_use'];
     unset(self::$records[$key]);
     if (self::$xhprof) {
         Log::info($logName, array($times, $mem_use, $run_id, $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'], \json_encode($_REQUEST)));
     } else {
         $startServTime = date('Y-m-d H:i:s', START_SERV_TIME);
         Log::info($logName, ["Serv start run time:({$startServTime}) [ use times:" . $times . " ms ]", "[ use mems:" . self::convert($mem_use) . " ]."]);
     }
 }
Exemplo n.º 3
0
 public static function info($data, $file = "info")
 {
     ZLog::info($file, $data);
 }