/** * Log an error. * @param PLUGError * @return string formatted error string */ private static function logdisplay(PLUGError $Err) { $logline = sprintf('[uid:%s] %s: %s in %s on line %u', PLUG::current_user(), $Err->getTypeString(), $Err->getMessage(), $Err->getFile(), $Err->getLine()); // Add data to log that some SAPIs miss out. switch (PHP_SAPI) { // Apache2 doesn't date stamp the error log. case 'apache2handler': $logline = '[' . date('D M d H:i:s Y') . '] ' . $logline; break; // Apache1.3 doesn't add the client IP address // Apache1.3 doesn't add the client IP address case 'apache': $logline = '[client ' . $_SERVER['REMOTE_ADDR'] . '] ' . $logline; break; } return $logline; }