summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
Diffstat (limited to 'it.class')
-rw-r--r--it.class10
1 files changed, 5 insertions, 5 deletions
diff --git a/it.class b/it.class
index a6091e3..d62a57c 100644
--- a/it.class
+++ b/it.class
@@ -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
{