diff options
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -122,7 +122,7 @@ static function timerlog($label = '') * @param $p['blockmailid'] block mail for $p['blockmail'] seconds with same id. Default: $p['to'] * @param $p['okstate'] give current ok label and state, e.g. telresult=1 . see failcount * @param $p['failcount'] give number of consecutive okstate failures needed for creating an error [2] - * @param $p['omitdebuginfo'] Do not add stack dump, locals and environment to output [false] + * @param $p['omitdebuginfo'] value 1 omits long stack and var dumps, value 2 also omits trace and url * @return true if a mail was sent */ static function error($p = array(), $body = null, $to = null) # $body and $to deprecated @@ -155,9 +155,9 @@ static function error($p = array(), $body = null, $to = null) # $body and $to de if ($p['okstate']) { - list($okid, $okstatus) = explode("=", $p['okstate']); - $failcount = $okstatus ? 0 : file_get_contents("/tmp/alertdata/$okid") + 1; - file_put_contents("/tmp/alertdata/$okid", "$failcount\n"); + list($okfn, $okstatus) = explode("=", "/tmp/alertdata/okstate_" . $p['okstate']); + $failcount = $okstatus ? 0 : @file_get_contents($okfn) + 1; + file_put_contents($okfn, "$failcount\n"); if ($failcount != $p['failcount']) return; } @@ -209,7 +209,7 @@ static function error($p = array(), $body = null, $to = null) # $body and $to de $p['body'] = "Body: " . getenv('HOSTNAME') . ":$datafn"; } - $body = ($p['body'] ? trim($p['body'])."\n\n" : "") . ($url && !$toscreen? "{$p['title']}\n\nUrl: $url\n\n" : "") . ($trace ? ($sendmail?"" :" ")."Trace: $trace\n\n" : ""); + $body = ($p['body'] ? trim($p['body'])."\n\n" : "") . ($p['omitdebuginfo'] >= 2 ? "" : ($url && !$toscreen? "{$p['title']}\n\nUrl: $url\n\n" : "") . ($trace ? ($sendmail?"" :" ")."Trace: $trace\n\n" : "")); if ($sendmail) # we're mailing: send maximum info { |