Skip to content
Snippets Groups Projects
Commit f1d9ee7a authored by hahn's avatar hahn
Browse files

logger - added render output for cli

parent d1ab9814
Branches
No related tags found
No related merge requests found
......@@ -138,6 +138,40 @@ class logger {
. '<script>$(\'#'.$sMaxRowId.'\').css(\'color\', \'#f00\');</script>';
return $sOut;
}
/**
* render output of all logging messages for cli output
* @return string
*/
public function renderCli(){
if (!$this->bShowDebug){
return false;
}
$sOut='';
$sStarttime=$this->aMessages[0]["time"];
$iCounter=0;
$sMaxRowId=false;
$iMaxtime=-1;
$sWarnings=false;
$iLasttime=$sStarttime;
foreach ($this->aMessages as $aLogentry){
$iCounter++;
$iDelta=$aLogentry["time"]-$iLasttime;
$sOut.=$aLogentry["level"].' '
. $iCounter.' '
.sprintf("%01.3f", $aLogentry["time"]-$sStarttime).' '
.sprintf("%01.3f", $iDelta).' '
.$aLogentry["level"].' '
.$aLogentry["message"].' '
. "\n"
;
$iLasttime=$aLogentry["time"];
}
// $iTotal=$iLasttime-$sStarttime;
return $sOut;
}
}
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment