diff options
author | Urban Müller | 2020-05-25 18:09:50 +0200 |
---|---|---|
committer | Urban Müller | 2020-05-25 18:09:50 +0200 |
commit | f031e08bc3c1b829e294a5499c4176bd65850340 (patch) | |
tree | a2a583631fc11444127bea820fd033781fa0f0a8 | |
parent | 8bf25e3d0df107d9e2920740fccf247903cb612e (diff) | |
download | itools-f031e08bc3c1b829e294a5499c4176bd65850340.tar.gz itools-f031e08bc3c1b829e294a5499c4176bd65850340.tar.bz2 itools-f031e08bc3c1b829e294a5499c4176bd65850340.zip |
it::error should put (optional) single line content before multiline content
-rw-r--r-- | it.class | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -261,6 +261,8 @@ static function error($p = array()) ($trace ? ($sendmail ? "" : " ") . "Trace: $trace\n" : "")) . (!$sendmail || $p['omitdebuginfo'] >= 2 ? "" : "Host: " . getenv('HOSTNAME') . " at " . date("Y-m-d H:i:s") . (($t = time() - $_SERVER['REQUEST_TIME']) ? " (invoked {$t}s before)" : "") . "\n") . # no it::date() due to time- debug param self::$error_context . + ($p['id'] ? "Filter: timewindow=" . $p['graceperiod'] . "-" . ($p['graceperiod'] + $p['timewindow']) . " (previous err: " . it::date('', $errstamp) . ")\n" : "") . + ($origp['blockmail'] ? "Block-resend: " . $origp['blockmail'] . " seconds\n" : "") . ($p['body'] ? ($p['omitdebuginfo'] ? "" : "Body:\n") . trim($p['body'])."\n\n" : ""); if ($sendmail) # we're mailing: send maximum info @@ -273,9 +275,7 @@ static function error($p = array()) if ($level >= $p['backtraceskip'] && $tracesize < 100000 && ($tracesize += strlen(print_r($stackframe, true))) < 100000) # save mem $stackframes[] = $stackframe; - $body .= $p['id'] ? "Filter: timewindow=" . $p['graceperiod'] . "-" . ($p['graceperiod'] + $p['timewindow']) . " (previous err: " . it::date('', $errstamp) . ")\n" : ""; - $body .= $origp['blockmail'] ? "Block-resend: " . $origp['blockmail'] . " seconds\n" : ""; - $body .= ($trace and $t = it::exec('grep -h {0} `ls /tmp/alertdata/alertlog-*|tail -3` /dev/null 2>/dev/null | grep ^2 | cut -d : -f 1-2 | sort | uniq -c | tail -10', $trace)) ? "Histogram: (last 10 affected minutes in 3 days)\n$t\n" : ""; + $body .= ($trace and $t = it::exec('grep -h {0} `ls /tmp/alertdata/alertlog-*|tail -3` /dev/null 2>/dev/null | grep ^2 | cut -d : -f 1-2 | sort | uniq -c | tail -10', $trace)) ? "Histogram: (last 10 affected minutes in 3 days)\n$t" : ""; $body .= "\n"; $body .= $_GET ? "\$_GET: " . var_export($_GET, true) . "\n\n" : ""; $body .= $_POST ? "\$_POST: " . var_export($_POST, true) . "\n\n" : ""; |