49 function Log_display($name =
'', $ident =
'', $conf = array(),
52 $this->_id = md5(microtime());
53 $this->_ident = $ident;
57 if (!empty($conf[
'lineFormat'])) {
58 $this->_lineFormat = str_replace(array_keys($this->_formatMap),
59 array_values($this->_formatMap),
65 if (isset($conf[
'error_prepend'])) {
66 $prepend = $conf[
'error_prepend'];
68 $prepend = ini_get(
'error_prepend_string');
70 if (!empty($prepend)) {
76 if (isset($conf[
'error_append'])) {
77 $append = $conf[
'error_append'];
79 $append = ini_get(
'error_append_string');
81 if (!empty($append)) {
82 $this->_lineFormat .= $append;
86 if (isset($conf[
'linebreak'])) {
87 $this->_lineFormat .= $conf[
'linebreak'];
89 $this->_lineFormat .=
"<br />\n";
93 if (!empty($conf[
'timeFormat'])) {
94 $this->_timeFormat = $conf[
'timeFormat'];
106 $this->_opened =
true;
118 $this->_opened =
false;
134 function log($message, $priority = null)
137 if ($priority === null) {
150 echo $this->
_format($this->_lineFormat,
151 strftime($this->_timeFormat),
153 nl2br(htmlspecialchars($message)));
156 $this->
_announce(array(
'priority' => $priority,
'message' => $message));
_announce($event)
Informs each registered observer instance that a new message has been logged.
close()
Closes the display handler.
UPTO($priority)
Calculate the log mask for all priorities up to the given priority.
open()
Opens the display handler.
Log_display($name='', $ident='', $conf=array(), $level=PEAR_LOG_DEBUG)
Constructs a new Log_display object.
log($message, $priority=null)
Writes $message to the text browser.
_isMasked($priority)
Check if the given priority is included in the current level mask.
_extractMessage($message)
Returns the string representation of the message data.
_format($format, $timestamp, $priority, $message)
Produces a formatted log line based on a format string and a set of variables representing the curren...