Skip to content
Snippets Groups Projects
Commit b61d4525 authored by Axel Hahn's avatar Axel Hahn
Browse files

- added: skip dereferenced tags in git (tags ending ^{} )

- added: modal infobox in build page if you switch the branch
- added: git uses a cache for taglist and revision infos (ttl is 5 min)
- added client dubugging (axels ip)
- reactivated: menu project->actipons->cleanup to delete the cache
- changed: cut commit message a bit: do not show * [new branch]
parent f28b00b2
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,11 @@ class logger { ...@@ -29,6 +29,11 @@ class logger {
return $this->bShowDebug=$bEnable; return $this->bShowDebug=$bEnable;
} }
/**
* enable client debugging by a given array of allowed ip addresses
* @param type $aIpArray
* @return boolean
*/
public function enableDebugByIp($aIpArray){ public function enableDebugByIp($aIpArray){
$this->enableDebug(false); $this->enableDebug(false);
if (!$_SERVER || !is_array($_SERVER) || !array_key_exists("REMOTE_ADDR", $_SERVER)){ if (!$_SERVER || !is_array($_SERVER) || !array_key_exists("REMOTE_ADDR", $_SERVER)){
...@@ -71,18 +76,49 @@ class logger { ...@@ -71,18 +76,49 @@ class logger {
} }
$sOut=''; $sOut='';
$sStarttime=$this->aMessages[0]["time"]; $sStarttime=$this->aMessages[0]["time"];
$iCounter=0;
$sMaxRowId=false;
$iMaxtime=-1;
$sWarnings=false;
$iLasttime=$sStarttime; $iLasttime=$sStarttime;
foreach ($this->aMessages as $aLogentry){ foreach ($this->aMessages as $aLogentry){
$sOut.='<tr class="'.$aLogentry["level"].'">'. $iCounter++;
'<!-- <td>'.$aLogentry["time"].'</td> -->'. $sTrId='debugTableRow'.$iCounter;
'<td>'.sprintf("%01.4f", $aLogentry["time"]-$sStarttime).'</td>'. $iDelta=$aLogentry["time"]-$iLasttime;
'<td>'.sprintf("%01.4f", $aLogentry["time"]-$iLasttime).'</td>'. if ($iDelta > $iMaxtime){
$iMaxtime=$iDelta;
$sMaxRowId=$sTrId;
}
$sStyle=($iDelta > 1)?'color: #f82;':'';
if (($iDelta > 1)){
$sWarnings.='<a href="#'.$sTrId.'" title="'.sprintf("%01.4f", $iDelta).' s">'.$iCounter.'</a>&nbsp;';
}
$sOut.='<tr class="'.$aLogentry["level"].'" id="'.$sTrId.'" style="'.$sStyle.'">'.
'<td>'.$iCounter.'</td>'.
'<td>'.sprintf("%01.3f", $aLogentry["time"]-$sStarttime).'</td>'.
'<td>'.sprintf("%01.3f", $iDelta).'</td>'.
'<td>'.$aLogentry["level"].'</td>'. '<td>'.$aLogentry["level"].'</td>'.
'<td>'.$aLogentry["message"].'</td>'. '<td>'.$aLogentry["message"].'</td>'.
'</tr>'; '</tr>';
$iLasttime=$aLogentry["time"]; $iLasttime=$aLogentry["time"];
}
$iTotal=$iLasttime-$sStarttime;
if ($sWarnings){
$sWarnings='<br>warnings:&nbsp;'.$sWarnings;
} }
if ($sOut) $sOut=' if ($sOut) $sOut='
<div style="position: fixed; right: 1em; top: 6em; background: rgba(255,80,80, 0.1); padding: 0.5em;">
<span style="font-size: 130%;">total:&nbsp;'.sprintf("%01.3f", $iTotal).'&nbsp;s</span><br>
<span>longest&nbsp;action:&nbsp;<a href="#'.$sMaxRowId.'">'.sprintf("%01.3f", $iMaxtime).'&nbsp;s</a></span>
<span>'.$sWarnings.'</span>
</div>
<br> <br>
<br> <br>
<br> <br>
...@@ -92,13 +128,14 @@ class logger { ...@@ -92,13 +128,14 @@ class logger {
<table class="datatable table table-striped debugtable"> <table class="datatable table table-striped debugtable">
<thead> <thead>
<tr> <tr>
<!-- <th>time</th> --> <th>#</th>
<th>delta to start time</th> <th>delta to start time</th>
<th>delta to previuos</th> <th>delta to previuos</th>
<th>level</th> <th>level</th>
<th>message</th> <th>message</th>
</tr></thead><tbody> </tr></thead><tbody>
'.$sOut.'</tbody></table>'; '.$sOut.'</tbody></table>'
. '<script>$(\'#'.$sMaxRowId.'\').css(\'color\', \'#f00\');</script>';
return $sOut; return $sOut;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment