Пример #1
0
 public function __construct()
 {
     @set_exception_handler(array($this, 'exceptionHandler'));
     // set default error level to all
     $this->level = 1;
     // catch all errors
     $old_error_handler = set_error_handler(array($this, 'errorHandler'));
     $buckets = \Singleton::fmConfig()->getVars("CONFIG/LOGGING/BUCKETS");
     if (count($buckets) == 0) {
         return;
     }
     $this->buckets = array();
     $b = 0;
     foreach ($buckets as $bucket) {
         if ($bucket["TYPE"] == "FILE") {
             $this->buckets[$b]["INSTANCE"] = new Filelog($bucket["URI"]);
             $this->buckets[$b]["LEVEL"] = $bucket["LEVEL"];
         }
         if ($bucket["TYPE"] == "PLUGIN") {
             if ($bucket["URI"] == "FireBug") {
                 if ($bucket["LEVEL"] > 0) {
                     $this->buckets[$b]["INSTANCE"] = new Firelog($bucket["URI"]);
                     $this->buckets[$b]["LEVEL"] = $bucket["LEVEL"];
                 }
             }
             if ($bucket["URI"] == "Echo") {
                 $this->buckets[$b]["INSTANCE"] = new EchoLog($bucket["URI"]);
                 $this->buckets[$b]["LEVEL"] = $bucket["LEVEL"];
             }
         }
         $b++;
     }
     $this->enabled = true;
 }