colourize sql/rrd debugging yellow/green

git-svn-id: http://www.observium.org/svn/observer/trunk@3224 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-05-22 13:41:04 +00:00
parent d3796004ae
commit 7cb9e665e9
2 changed files with 9 additions and 10 deletions

View File

@@ -24,7 +24,11 @@ Usage
function dbQuery($sql, $parameters = array()) { function dbQuery($sql, $parameters = array()) {
global $fullSql, $debug; global $fullSql, $debug;
$fullSql = dbMakeQuery($sql, $parameters); $fullSql = dbMakeQuery($sql, $parameters);
if($debug) { echo("\nSQL[".$fullSql."] "); } if($debug) {
print Console_Color::convert("\nSQL[%y".$fullSql."%n] ");
#echo("\nSQL[".$fullSql."] ");
}
/* /*
if($this->logFile) if($this->logFile)
$time_start = microtime(true); $time_start = microtime(true);

View File

@@ -155,7 +155,7 @@ function rrdtool($command, $filename, $options)
if ($config['norrd']) if ($config['norrd'])
{ {
print Console_Color::convert("%g RRD Disabled %n", false); print Console_Color::convert("[%rRRD Disabled%n]");
} else { } else {
fwrite($rrd_pipes[0], $cmd."\n"); fwrite($rrd_pipes[0], $cmd."\n");
} }
@@ -163,10 +163,7 @@ function rrdtool($command, $filename, $options)
{ {
echo stream_get_contents($rrd_pipes[1]); echo stream_get_contents($rrd_pipes[1]);
echo stream_get_contents($rrd_pipes[2]); echo stream_get_contents($rrd_pipes[2]);
print Console_Color::convert("RRD[%g".$cmd."%n] ");
echo("<p>");
echo("\n".$cmd."\n");
echo("</p>");
} else { } else {
$tmp = stream_get_contents($rrd_pipes[1]).stream_get_contents($rrd_pipes[2]); $tmp = stream_get_contents($rrd_pipes[1]).stream_get_contents($rrd_pipes[2]);
} }
@@ -186,15 +183,13 @@ function rrdtool_create($filename, $options)
if ($config['norrd']) if ($config['norrd'])
{ {
print Console_Color::convert("%g RRD Disabled %n", false); print Console_Color::convert("[%gRRD Disabled%n] ", false);
} else { } else {
$command = $config['rrdtool'] . " create $filename $options"; $command = $config['rrdtool'] . " create $filename $options";
} }
if ($debug) { echo($command."\n"); } if ($debug) { print Console_Color::convert("RRD[%g".$command."%n] "); }
return shell_exec($command); return shell_exec($command);
# return rrdtool("create", $filename, $options);
} }
function rrdtool_update($filename, $options) function rrdtool_update($filename, $options)