ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
null.php
Go to the documentation of this file.
1 <?php
19 class Log_null extends Log
20 {
30  function Log_null($name, $ident = '', $conf = array(),
31  $level = PEAR_LOG_DEBUG)
32  {
33  $this->_id = md5(microtime());
34  $this->_ident = $ident;
35  $this->_mask = Log::UPTO($level);
36  }
37 
44  function open()
45  {
46  $this->_opened = true;
47  return true;
48  }
49 
56  function close()
57  {
58  $this->_opened = false;
59  return true;
60  }
61 
74  function log($message, $priority = null)
75  {
76  /* If a priority hasn't been specified, use the default value. */
77  if ($priority === null) {
78  $priority = $this->_priority;
79  }
80 
81  /* Abort early if the priority is above the maximum logging level. */
82  if (!$this->_isMasked($priority)) {
83  return false;
84  }
85 
86  $this->_announce(array('priority' => $priority, 'message' => $message));
87 
88  return true;
89  }
90 
91 }
_announce($event)
Informs each registered observer instance that a new message has been logged.
Definition: Log.php:811
UPTO($priority)
Calculate the log mask for all priorities up to the given priority.
Definition: Log.php:642
$Header$
close()
Closes the handler.
Definition: null.php:56
Log_null($name, $ident='', $conf=array(), $level=PEAR_LOG_DEBUG)
Constructs a new Log_null object.
Definition: null.php:30
$_priority
Definition: Log.php:69
log($message, $priority=null)
Simply consumes the log event.
Definition: null.php:74
_isMasked($priority)
Check if the given priority is included in the current level mask.
Definition: Log.php:726
const PEAR_LOG_DEBUG
Definition: Log.php:17
open()
Opens the handler.
Definition: null.php:44