format('Y-m-d'). '
' . $d->format('H:i:s') : ""; echo ""; echo "$date"; echo ''; echo $d ? $d->format('u') : ""; echo ''; echo "$component$level$msg "; if ($level != "DEBUG") { echo ''; echo ''; } else echo ''; } function render_rows () { global $lines; foreach ($lines as $line) { render_row ($line[0], $line[1], $line[2], $line[3], $line[4], $line[5]); } } function process ($line, $c) { global $lines; $a = explode (' ', $line); if (count($a) < 6) return; $date = DateTime::createFromFormat ("M d H:i:s-u", implode (' ', array_slice ($a, 0, 3))); $component = $a[3]; $level = $a[4]; $msg = implode (' ', array_slice ($a, 5)); $lines[] = array ($date, $component, 0, $level, $msg, $c); } if (array_key_exists ('a', $_GET)) { $start = (int)$_GET['a']; $ajax= TRUE; } else { $start = null; } if (array_key_exists ('z', $_GET)) { $stop = (int)$_GET['z']; $ajax= TRUE; } else { $stop = null; } $t0 = microtime(true); $handle = @fopen($path, 'r'); if ($handle) { $c = 0; while (($line = fgets($handle)) !== false) { if ((!$start || $c >= $start) && (!$stop || $c <= $stop)) { process ($line, $c); } $c++; } } else { echo "
Error opening file $path.
"; } $t1 = microtime(true); if ($start !== null || $stop !== null) { render_rows(); die(); } // echo $t1-$t0; ?> GNUnet log view
Date Time uSec Comp Level Message