Go to the source code of this file.
◆ render_row()
render_row |
( |
|
$d, |
|
|
|
$component, |
|
|
|
$pid, |
|
|
|
$level, |
|
|
|
$msg, |
|
|
|
$c |
|
) |
| |
Definition at line 13 of file log.php.
17 if (!
$ajax && $level ==
"DEBUG")
20 list($comp,$peer) = explode (
',', preg_replace (
'/(.*)-(\d*)/',
'\1,\2', $component));
21 $peer = array_key_exists ($peer,
$peers) ?
$peers[$peer] : $peer;
22 $date = $d ? $d->format(
'Y-m-d'). $d->format(
'H:i:s') :
"";
23 echo "<tr class=\"$level P-$peer C-$comp\" id=\"$c\">";
24 echo "<td class=\"date\"><small>$date</td>";
25 echo '<td class="usec"><small>';
26 echo $d ? $d->format(
'u') :
"";
28 echo "<td class=\"comp\">$comp</td><td class=\"peer\">$peer</td>";
29 echo "<td class=\"level\">$level</td><td><pre>$msg</pre></td>";
30 if ($level !=
"DEBUG")
32 echo '<td><div class="btn-group"><button class="btn btn-xs btn-default btn-showup"><span class="glyphicon glyphicon-chevron-up"></span></button>';
33 echo '<button class="btn btn-xs btn-default btn-showdown"><span class="glyphicon glyphicon-chevron-down"></span></button></div></td>';
static int list
Set if we should print a list of currently running services.
static int echo
Request echo service.
References $ajax, $peers, echo, and list.
Referenced by render_rows().
◆ render_rows()
Definition at line 40 of file log.php.
43 foreach (
$lines as $line) {
44 render_row ($line[0], $line[1], $line[2], $line[3], $line[4], $line[5]);
render_row($d, $component, $pid, $level, $msg, $c)
References $lines, and render_row().
◆ process()
Definition at line 48 of file log.php.
53 $a = explode (
' ', $line);
56 $date = DateTime::createFromFormat (
"M d H:i:s-u", implode (
' ', array_slice ($a, 0, 3)));
59 $msg = implode (
' ', array_slice ($a, 5));
61 if (FALSE !== strpos($line,
"STARTING SERVICE")) {
62 $id = preg_replace (
"/.*\[(....)\].*\n/",
'\1', $line);
63 $pid = preg_replace (
"/.*[a-z-]*-([0-9]*).*\n/",
'\1', $line);
67 $lines[] = array ($date, $component, 0, $level, $msg,
$c);
68 $comp = preg_replace (
'/(.*)-\d*/',
'\1', $component);
72 if (array_key_exists (
'a', $_GET)) {
73 $start = (
int)$_GET[
'a'];
80 if (array_key_exists (
'z', $_GET)) {
81 $stop = (
int)$_GET[
'z'];
88 $t0 = microtime(
true);
92 while (($line = fgets(
$handle)) !==
false) {
93 if (!$start ||
$c >= $start) {
97 if ($stop &&
$c > $stop)
101 echo "<div class=\"alert alert-danger\">Error opening file $path.</div>";
104 $t1 = microtime(
true);
106 if ($start !==
null || $stop !==
null) {
117 <
meta charset=
"utf-8">
118 <
meta http-equiv=
"X-UA-Compatible" content=
"IE=edge">
119 <
meta name=
"viewport" content=
"width=device-width, initial-scale=1">
121 <title>GNUnet log view</title>
123 <!-- Latest compiled and minified Bootstrap CSS -->
124 <link rel=
"stylesheet" href=
"//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css">
125 <!-- Optional theme -->
126 <link rel=
"stylesheet" href=
"//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap-theme.min.css">
130 font-family: arial,sans-serif;
136 border-collapse:collapse;
142 background-color: transparent;
149 margin: 5% 0 0 -37.5%;
163 background-color:#CCC;
166 background-color:#EB9316;
169 background-color:#D2322D;
174 table.table tbody tr td,
175 table.table tbody th td {
176 padding: 0px 0px 0px 2px;
181 foreach (
$peers as $peer) {
182 echo "table.table tbody tr.P-$peer td.peer {\n";
static struct PendingResolutions * head
Head of list of pending resolution requests.
static struct GNUNET_FS_MetaData * meta
Meta-data provided via command-line option.
static struct PeerEntry ** table
Table with our interned peer IDs.
static unsigned int size
Size of the "table".
References $c, $comps, $lines, and $peers.
◆ $path
◆ $lines
◆ $peers
◆ $comps
◆ $ajax
◆ $colors
Initial value:= array('#F00', '#F80', '#FF0',
'#4F0', '#0A0',
'#22F', '#ADF', '#0FF', '#F0F', '#508', '#FAA',
'#FFF', '#AAA', '#666', '#222')
Definition at line 8 of file log.php.
◆ else
Initial value:
Definition at line 76 of file log.php.
◆ $t0
◆ $handle
◆ $t1
◆ $c
◆ foreach