Source for file jLogMessage.class.php

Documentation is available at jLogMessage.class.php

  1. <?php
  2. /**
  3. @package    jelix
  4. @subpackage core
  5. @author     Laurent Jouanneau
  6. @copyright  2006-2010 Laurent Jouanneau
  7. @link       http://www.jelix.org
  8. @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
  9. */
  10.  
  11. /**
  12.  * class that handles a simple message for a logger
  13.  */
  14. class jLogMessage implements jILogMessage {
  15.     /**
  16.      * @var string the category of the message
  17.      */
  18.     protected $category;
  19.  
  20.     /**
  21.      * @var string the message
  22.      */
  23.     protected $message;
  24.  
  25.     public function __construct($message$category='default'{
  26.         $this->category = $category;
  27.         $this->message = $message;
  28.     }
  29.  
  30.     public function getCategory({
  31.         return $this->category;
  32.     }
  33.  
  34.     public function getMessage({
  35.         return $this->message;
  36.     }
  37.  
  38.     public function getFormatedMessage({
  39.         return $this->message;
  40.     }
  41. }
  42.  
  43. /**
  44.  * class that handles a dump of a php value, for a logger
  45.  */
  46. class jLogDumpMessage  extends jLogMessage {
  47.     /**
  48.      * @var string the additionnal label
  49.      */
  50.     protected $label;
  51.  
  52.     public function __construct($obj$label=''$category='default'{
  53.         $this->message = var_export($obj,true);
  54.         $this->category = $category;
  55.         $this->label = $label;
  56.     }
  57.  
  58.     public function getLabel({
  59.         return $this->label;
  60.     }
  61.  
  62.     public function getFormatedMessage({
  63.         if ($this->label{
  64.             return $this->label.': '.$this->message;
  65.         }
  66.         return $this->message;
  67.     }
  68. }

Documentation generated on Mon, 19 Sep 2011 14:13:16 +0200 by phpDocumentor 1.4.3