Show
Ignore:
Timestamp:
02/18/11 20:25:42 (2 years ago)
Author:
p_lindheimer
Message:

more format tweaks for PHP errors

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.9/amp_conf/htdocs/admin/libraries/utility.functions.php

    r11456 r11457  
    4545    // PHP Error Handler provides it's own formatting 
    4646    // 
    47     $txt = sprintf("[%s] %s\n", $level, $message); 
     47    $txt = sprintf("[%s-%s\n", $level, $message); 
    4848  } 
    4949 
     
    306306  global $amp_conf; 
    307307 
     308  $errortype = array ( 
     309    E_ERROR              => 'ERROR', 
     310    E_WARNING            => 'WARNING', 
     311    E_PARSE              => 'PARSE_ERROR', 
     312    E_NOTICE             => 'NOTICE', 
     313    E_CORE_ERROR         => 'CORE_ERROR', 
     314    E_CORE_WARNING       => 'CORE_WARNING', 
     315    E_COMPILE_ERROR      => 'COMPILE_ERROR', 
     316    E_COMPILE_WARNING    => 'COMPILE_WARNING', 
     317    E_USER_ERROR         => 'USER_ERROR', 
     318    E_USER_WARNING       => 'USER_WARNING', 
     319    E_USER_NOTICE        => 'USER_NOTICE', 
     320    E_STRICT             => 'RUNTIM_NOTICE', 
     321    E_RECOVERABLE_ERROR  => 'CATCHABLE_FATAL_ERROR', 
     322  ); 
     323 
    308324  if (!isset($amp_conf['PHP_ERROR_HANDLER_OUTPUT'])) { 
    309325    $amp_conf['PHP_ERROR_HANDLER_OUTPUT'] = 'dbug'; 
     
    312328  switch($amp_conf['PHP_ERROR_HANDLER_OUTPUT']) { 
    313329  case 'freepbxlog': 
    314     $txt = sprintf("(%s:%s)-ERRNO[%s] - %s", $errfile, $line, $errorno, $errstr); 
     330    $txt = sprintf("%s] (%s:%s) - %s", $errortype[$errno], $errfile, $errline, $errstr); 
    315331    freepbx_log(FPBX_LOG_PHP,$txt); 
    316332  break; 
     
    321337    $txt = date("Y-M-d H:i:s") 
    322338      . "\t" . $errfile . ':' . $errline  
    323       . "\n\n
    324       . 'ERROR[' . $errno . ']: ' 
     339      . "\n
     340      . '[' . $errortype[$errno] . ']: ' 
    325341      . $errstr 
    326       . "\n\n\n"; 
     342      . "\n\n"; 
    327343      dbug_write($txt,$check=''); 
    328344  break;