コード例 #1
0
ファイル: zlog.php プロジェクト: inkoss/karoshi-server
 /**
  * Returns the string to be logged
  *
  * @access private
  * @return string
  */
 private static function buildLogString($loglevel)
 {
     if (!isset(self::$pidstr)) {
         self::$pidstr = '[' . str_pad(@getmypid(), 5, " ", STR_PAD_LEFT) . '] ';
     }
     if (!isset(self::$user)) {
         self::$user = '';
     }
     if (!isset(self::$devid)) {
         self::$devid = '';
     }
     if (self::$syslogEnabled) {
         return self::$pidstr . self::getLogLevelString($loglevel, LOGLEVEL > LOGLEVEL_INFO) . " " . self::$user . self::$devid;
     } else {
         return Utils::GetFormattedTime() . " " . self::$pidstr . self::getLogLevelString($loglevel, LOGLEVEL > LOGLEVEL_INFO) . " " . self::$user . self::$devid;
     }
 }