Exemple #1
0
 /**
  * 打印日志
  * @param string $priority
  * @param string $event
  * @param string $method
  * @param integer $errno
  * @return void
  */
 public static function write($priority, $event, $method = '', $errno = 0)
 {
     $common = array('app' => APP_NAME, 'err_no' => $errno, 'user_id' => UserIdentity::getId(), 'module' => Mvc::$module, 'controller' => Mvc::$controller, 'action' => Mvc::$action);
     if (!is_array($event)) {
         $event = array('msg' => $event);
     }
     $events = array_merge($common, $event);
     self::getLogger()->write($events, $priority, $method);
 }
Exemple #2
0
 /**
  * 获取用户ID
  * @return integer
  */
 public static function getUserId()
 {
     return UserIdentity::getId();
 }