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;
}
}
if ('' != $below) {
?>
clearRaisedMessages();
}
/**
* Logs messages to defined channels: file, email, sms, and screen. Repeated messages are
* not repeated but printed once with count. Log events that match a sendable channel (email or SMS)
* are sent once per 'log_multiple_timeout' setting (to avoid a flood of error emails).
*
* @access public
* @param string $message The text description of the message.
* @param int $priority The type of message priority (in descending order):
* LOG_EMERG 0 system is unusable
* LOG_ALERT 1 action must be taken immediately
* LOG_CRIT 2 critical conditions
* LOG_ERR 3 error conditions
* LOG_WARNING 4 warning conditions
* LOG_NOTICE 5 normal, but significant, condition
* LOG_INFO 6 informational message
* LOG_DEBUG 7 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);
}
// Before we get any further, let's see if ANY log events are configured to be reported.
if ((false === $this->getParam('log_file_priority') || $priority > $this->getParam('log_file_priority'))
&& (false === $this->getParam('log_email_priority') || $priority > $this->getParam('log_email_priority'))
&& (false === $this->getParam('log_sms_priority') || $priority > $this->getParam('log_sms_priority'))
&& (false === $this->getParam('log_screen_priority') || $priority > $this->getParam('log_screen_priority'))) {
// This event would not be recorded, skip it entirely.
return false;
}
// 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.