ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 }