0 && $this->getParam('display_errors') && isset($m['file']) && isset($m['line'])) {
echo "\n';
}
switch ($m['type']) {
case MSG_ERR:
echo '
' . $m['message'] . '
';
break;
case MSG_WARNING:
echo '
' . $m['message'] . '
';
break;
case MSG_SUCCESS:
echo '
' . $m['message'] . '
';
break;
case MSG_NOTICE:
default:
echo '
' . $m['message'] . '
';
break;
}
}
?>
clearRaisedMessages();
}
/**
* Logs messages to defined channels: file, email, sms, and screen. Repeated messages are
* not repeated but printed once with count.
*
* @access public
* @param string $message The text description of the message.
* @param int $priority The type of message priority (in descending order):
* LOG_EMERG system is unusable
* LOG_ALERT action must be taken immediately
* LOG_CRIT critical conditions
* LOG_ERR error conditions
* LOG_WARNING warning conditions
* LOG_NOTICE normal, but significant, condition
* LOG_INFO informational message
* LOG_DEBUG debug-level message
* @param string $file The file where the log event occurs.
* @param string $line The line of the file where the log event occurs.
*/
function logMsg($message, $priority=LOG_INFO, $file=null, $line=null)
{
static $previous_events = array();
// If priority is not specified, assume the worst.
if (!$this->logPriorityToString($priority)) {
$this->logMsg(sprintf('Log priority %s not defined. (Message: %s)', $priority, $message), LOG_EMERG, $file, $line);
$priority = LOG_EMERG;
}
// If log file is not specified, don't log to a file.
if (!$this->getParam('log_directory') || !$this->getParam('log_filename') || !is_dir($this->getParam('log_directory')) || !is_writable($this->getParam('log_directory'))) {
$this->setParam(array('log_file_priority' => false));
// We must use trigger_error to report this problem rather than calling $app->logMsg, which might lead to an infinite loop.
trigger_error(sprintf('Codebase error: log directory (%s) not found or writable.', $this->getParam('log_directory')), E_USER_NOTICE);
}
// Make sure to log in the system's locale.
$locale = setlocale(LC_TIME, 0);
setlocale(LC_TIME, 'C');
// Strip HTML tags except any with more than 7 characters because that's probably not a HTML tag, e.g.