Example #1
0
 /**
  * Return log writers
  * 
  * @return array
  */
 public static function getWriters()
 {
     if (is_null(self::$_writers)) {
         $writers = Config::getInstance("JooS_Log")->writers;
         /* @var $writers JooS_Config */
         if (!is_null($writers)) {
             foreach ($writers->valueOf() as $name) {
                 $name = ucfirst(strtolower($name));
                 $className = Loader::getClassName(__NAMESPACE__ . "\\", $name);
                 if (Loader::loadClass($className)) {
                     $writer = new $className();
                     if ($writer instanceof Log_Interface) {
                         self::addWriter($writer);
                     }
                 }
             }
         } else {
             self::$_writers = array();
         }
     }
     return self::$_writers;
 }