记录运行日志

@param string $msg
@param string $level 日志级别：info、error、warning
7338
private function log($msg, $level = 'info') {
        static $logFile = null;
        if (is_null($logFile)) {
            $logDir = $this->appContext->getRuntimeDir() . '/log';
            if (!is_dir($logDir)) {
                mkdir($logDir, 0755, true);
            }
            $logFilePath = "$logDir/event-listend.log";
            $logFile = fopen($logFilePath, 'a');
        }

        $time = date('Y-m-d H:i:s');
        $logData = "[{$level}] [{$time}] {$msg}\n";
        fwrite($logFile, $logData);
    }
1370632
public function log($level, $message, array $context = array())
    {
        $this->logMessage(
            $level,
            $this->getFormattedMessage($level, $message)
        );
    }
1164255
protected function syslog($message, $level) {
        switch ($level) {
            case GearmanManager::LOG_LEVEL_INFO;
            case GearmanManager::LOG_LEVEL_PROC_INFO:
            case GearmanManager::LOG_LEVEL_WORKER_INFO:
            default:
                $priority = LOG_INFO;
                break;
            case GearmanManager::LOG_LEVEL_DEBUG:
                $priority = LOG_DEBUG;
                break;
        }

        if (!syslog($priority, $message)) {
            echo "Unable to write to syslog\n";
        }
    }
544180
public function log($level, $message, array $context = array()) {
		$result = call_user_func($this->callback, $level, $message, $context);
		if($result) {
			$this->logger()->log($level, $message, $context);
		}
	}
16077
public function log($level, $message, array $context = array()) {
		$fn = $this->callback;
		$fn($level, $message, $context);
		$this->logger()->log($level, $message, $context);
	}
1053170
public function log($level, $message, array $context = array())
    {
        $this->getApplication()->getInitialContext()->getSystemLogger()->log($level, $message, $context);
    }
401237
protected function log($level, $message, array $context = array())
    {
        if (null === $this->logger && $this->getServiceManager()->has('logger')) {
            $this->logger = $this->getServiceManager()->get('logger');
        }

        if ($this->logger) {
            $this->logger->log($level, $message, $context);
        }
    }
929396
final protected function log(string $level, string $message, array $context = [])
    {
        $this->provider('logger')->log($level, $message, $context);
    }
1059493
public function log ($level, $message, array $context = [])
  {
    $levelName = isset(self::$LEVELS[$level]) ? self::$LEVELS[$level] : $level;
    $message   = Debug::interpolate ($message, $context);
    $this->write ("<#log><#i><span class=__alert>$levelName</span> $message</#i></#log>");
  }
1184837
public function log($level, $message, array $context = array())
    {
        if ($this->level > $level || array_key_exists($level, $this->levels) === false) {
            return;
        }

        $this->out($this->levels[$level], $message, $context);
    }
78458
public function log($level, $message, array $context = []) {
		if (!Logger::check($level)) {
			return;
		}
		//获取SeasLog的常量
		\SeasLog::log($this->getLevel($level), $message, $context, Logger::getName());
	}
1360679
public function log($message, $level = LogLevel::INFO, $context = array())
    {
        // Skip if no logger has been loaded.
        if (!$this->logger) {
            return;
        }

        if (!is_array($message)) {
            $message = array($message);
        }

        // The build is added to the context so the logger can use
        // details from it if required.
        $context['build'] = $this->build;

        foreach ($message as $item) {
            $this->logger->log($level, $item, $context);
        }
    }
179330
public function log($level, $message, array $context = array()) {
		try {
			if($this->messageType === null) {
				error_log($message);
			} elseif((int)$this->messageType === 0 || (int)$this->messageType === 4) {
				error_log($message, $this->messageType);
			} else {
				error_log($message, (int)$this->messageType, $this->destination, $this->extraHeaders);
			}
		} catch(\Exception $e) {
		}
	}
884233
public function log($level, $message, array $context = array())
    {
        $this->logMessage(
            $level,
            (
                $this->getLevelColor($level)
                . $this->getFormattedMessage($level, $message)
                . $this->getDefaultColor()
            )
        );
    }
960757
public function log($level, $message, array $context = array()) {
		$packet = array(
			'level' => $level,
			'message' => $message,
			'context' => $context,
			'now' => date('c')
		);
		$packet = array_merge($this->extra, $packet);
		$values = array();
		foreach($this->values as $valueDesc) {
			$key = $valueDesc[0];
			$value = array_key_exists($key, $packet) ? $packet[$key] : null;
			$values[] = call_user_func($valueDesc[1], $value);
		}
		$message = vsprintf($this->format, $values);
		$this->logger()->log($level, $message, $context);
	}
277266
public function log($level, $message, array $context = array())
    {
        return error_log(self::PREFIX.' '.strtoupper($level).': '.$message.' '.
            (!empty($context) ? print_r($context, true) : ''));
    }
389432
protected function write($level, $msg)
    {
        $time = date('Y-m-d H:i:s', time());
        $msg = "[" . $time . "][" . static::getLevelName($level) . "] " . $msg . PHP_EOL;

        if($this->debugOutput === true){
            echo $msg;
        }
        if (static::$silent) {
            return false;
        }
        if (!$this->isAllowed($level)) {
            return false;
        }
        $fh = fopen($this->logFile, 'a');
        if (!fwrite($fh, $msg)) {
            throw new \Exception('Failed to write to log file at ' . $this->logFile);
        }

        return true;
    }