问题
I have joomla 2.5 which log many deprecated warnings like Error::raiseNotice() is deprecated.
So I result width a big log file. Can I turn off this option, and log just my own exceptions?
回答1:
You can always place an error reporting condition in your index.php like: error_reporting(E_ALL ^ E_DEPRECATED);
For more info: http://php.net/manual/en/function.error-reporting.php
Or you can edit error.php in your joomla directory, and
public static function raiseNotice($code, $msg, $info = null)
{
// Deprecation warning.
JLog::add('JError::raiseNotice() is deprecated.', JLog::WARNING, 'deprecated');
//return JError::raise(E_NOTICE, $code, $msg, $info);
}
disable this function to raise deprecated warnings...
来源:https://stackoverflow.com/questions/14649052/prevent-joomla-api-to-log-deprecated-warning