Exemple #1
0
 /**
  * @return log
  */
 public static function getInstance()
 {
     if (self::$instance === null) {
         $startTime = defined('PROCESS_START_TIME') ? PROCESS_START_TIME : microtime(true) * 1000;
         self::$instance = new SLog($GLOBALS['LOG'], $startTime);
     }
     return self::$instance;
 }
Exemple #2
0
 /**
  * @return log
  */
 public static function getInstance()
 {
     if (self::$instance === null) {
         $startTime = microtime(true) * 1000;
         $logConf = !empty($GLOBALS['LOG_CONF']) ? $GLOBALS['LOG_CONF'] : 'default';
         $logConfig = SConfig::getConfig(ROOT_CONFIG . "/log.conf", $logConf);
         if (!empty($logConfig->filename)) {
             $logConfig->filename = sprintf($logConfig->filename, date('Ymd'));
             self::$instance = new SLog($logConfig, $startTime);
         } else {
             $stdClass = new stdClass();
             $stdClass->appName = 'AllLog';
             $stdClass->type = 'LOCAL_LOG';
             $stdClass->level = '0x15';
             $stdClass->path = '/tmp';
             $stdClass->filename = 'All_log.' . date('Ymd');
             self::$instance = new SLog($stdClass, $startTime);
         }
     }
     return self::$instance;
 }