summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2020-05-12 02:43:07 +0200
committerUrban Müller2020-05-12 02:43:07 +0200
commit1e1ccf69633070beaf638eeb6712962ad361a48a (patch)
tree1b92e083815cc8a577630713aa8fae2c8705813b
parentc2a82199acca702cff6c4d1b359c1a4118c91b96 (diff)
downloaditools-1e1ccf69633070beaf638eeb6712962ad361a48a.tar.gz
itools-1e1ccf69633070beaf638eeb6712962ad361a48a.tar.bz2
itools-1e1ccf69633070beaf638eeb6712962ad361a48a.zip
optionally add global extra info to all errs
-rw-r--r--it.class3
1 files changed, 3 insertions, 0 deletions
diff --git a/it.class b/it.class
index b3505ea..a4341ae 100644
--- a/it.class
+++ b/it.class
@@ -21,6 +21,8 @@
class it
{
+static $error_context; # Text that will be added to all it_error mails
+
/**
* Create config class with static members initialized (e.g. $home).
* NOTE: PHP5 ONLY
@@ -258,6 +260,7 @@ static function error($p = array())
($trace ? ($sendmail ? "" : " ") . "Trace: $trace\n\n" : "")) .
(!$sendmail || $p['omitdebuginfo'] >= 2 ? "" : "Host: " . getenv('HOSTNAME') . "\n\n") .
(!$sendmail || $p['omitdebuginfo'] >= 2 ? "" : "Time: " . date("Y-m-d H:i:s") . (($t = time() - $_SERVER['REQUEST_TIME']) ? " (invoked {$t}s before)" : "") . "\n\n") . # no it::date() due to time- debug param
+ self::$error_context .
($p['body'] ? ($p['omitdebuginfo'] ? "" : "Body:\n") . trim($p['body'])."\n\n" : "");
if ($sendmail) # we're mailing: send maximum info