ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
Log.php
Go to the documentation of this file.
1 <?php
53 class Slim_Log {
54 
58  protected $logger;
59 
63  protected $enabled;
64 
68  public function __construct() {
69  $this->enabled = true;
70  }
71 
77  public function setEnabled( $enabled ) {
78  if ( $enabled ) {
79  $this->enabled = true;
80  } else {
81  $this->enabled = false;
82  }
83  }
84 
89  public function isEnabled() {
90  return $this->enabled;
91  }
92 
98  public function debug( $object ) {
99  return isset($this->logger) && $this->isEnabled() ? $this->logger->debug($object) : false;
100  }
101 
107  public function info( $object ) {
108  return isset($this->logger) && $this->isEnabled() ? $this->logger->info($object) : false;
109  }
110 
116  public function warn( $object ) {
117  return isset($this->logger) && $this->isEnabled() ? $this->logger->warn($object) : false;
118  }
119 
125  public function error( $object ) {
126  return isset($this->logger) && $this->isEnabled() ? $this->logger->error($object) : false;
127  }
128 
134  public function fatal( $object ) {
135  return isset($this->logger) && $this->isEnabled() ? $this->logger->fatal($object) : false;
136  }
137 
143  public function setLogger( $logger ) {
144  $this->logger = $logger;
145  }
146 
151  public function getLogger() {
152  return $this->logger;
153  }
154 
155 }
$enabled
Definition: Log.php:63
Definition: Log.php:53
$logger
Definition: Log.php:58
setEnabled( $enabled)
Enable or disable logging.
Definition: Log.php:77
fatal( $object)
Log fatal message.
Definition: Log.php:134
warn( $object)
Log warn message.
Definition: Log.php:116
setLogger( $logger)
Set Logger.
Definition: Log.php:143
error( $object)
Log error message.
Definition: Log.php:125
getLogger()
Get Logger.
Definition: Log.php:151
info( $object)
Log info message.
Definition: Log.php:107
debug( $object)
Log debug message.
Definition: Log.php:98
__construct()
Constructor.
Definition: Log.php:68
isEnabled()
Is logging enabled?
Definition: Log.php:89