Commit 8f8454df authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #274 in ZP/z-push from...

Merge pull request #274 in ZP/z-push from feature/ZP-958-allow-to-disable-logging-of-certain-error-levels to develop

* commit '36d62f47':
  ZP-958 Remove LOG_ERROR_MASK from config and make it a hidden feature.
  ZP-958 Allow to disable logging of certain error-levels.
parents 51905b08 36d62f47
......@@ -176,8 +176,13 @@ if (!defined('E_DEPRECATED')) define(E_DEPRECATED, 8192);
// TODO review error handler
function zpush_error_handler($errno, $errstr, $errfile, $errline, $errcontext) {
$bt = debug_backtrace();
if (defined('LOG_ERROR_MASK')) $errno &= LOG_ERROR_MASK;
switch ($errno) {
case 0:
// logging disabled by LOG_ERROR_MASK
break;
case E_DEPRECATED:
// do not handle this message
break;
......@@ -191,6 +196,7 @@ function zpush_error_handler($errno, $errstr, $errfile, $errline, $errcontext) {
break;
default:
$bt = debug_backtrace();
ZLog::Write(LOGLEVEL_ERROR, "trace error: $errfile:$errline $errstr ($errno) - backtrace: ". (count($bt)-1) . " steps");
for($i = 1, $bt_length = count($bt); $i < $bt_length; $i++) {
$file = $line = "unknown";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment