[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/logger/appender/ -> appender.class.php (source)

   1  <?php
   2  
   3      /**
   4       * Appender allows you to log messags to any location. Every appender has its own layout
   5       * that specifies the format of the messages, and every appender has a target location for messages.
   6       * This way, we can have an appender that writes log messages to a database, another one that writes
   7       * messages to a file, etc.
   8       *
   9       * @see LoggerManager
  10       * @see Logger
  11       * \ingroup logger     
  12       */
  13      class Appender
  14      {
  15          /**
  16           * The layout to be used for this appender.
  17           */
  18          var $layout;
  19          
  20          /**
  21           * used to keep the properties
  22           * @private
  23           */
  24          var $_properties;
  25  
  26          /**
  27           * Create a new Appender instance.
  28           *
  29           * @param Layout A Layout instance.
  30           */
  31          function Appender(&$layout, $properties)
  32          {
  33              $this->layout =& $layout;
  34              
  35              $this->_properties = $properties;
  36          }
  37  
  38          /**
  39           * Retrieve the layout this appender is using.
  40           *
  41           * @return Layout A Layout instance.
  42           */
  43          function & getLayout ()
  44          {
  45              return $this->layout;
  46          }
  47  
  48          /**
  49           * Set the layout this appender will use.
  50           *
  51           * @param Layout A Layout instance.
  52           */
  53          function setLayout (&$layout)
  54          {
  55              $this->layout =& $layout;
  56          }
  57  
  58          /**
  59           * Write to this appender.
  60           *
  61           * <br/><br/>
  62           *
  63           * <note>
  64           *     This should never be called manually.
  65           * </note>
  66           *
  67           * @param message The message to write.
  68           */
  69          function write ($message)
  70          {
  71              throw(new Exception("Appender::write: This method must be implemented by child classes."));
  72              die();
  73          }
  74      }
  75  
  76  ?>


Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics