<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ~~~ /** * 日志管理類 * @package think * @mixin Channel */ class Log extends Manager implements LoggerInterface { const EMERGENCY = 'emergency'; const ALERT = 'alert'; const CRITICAL = 'critical'; const ERROR = 'error'; const WARNING = 'warning'; const NOTICE = 'notice'; const INFO = 'info'; const DEBUG = 'debug'; const SQL = 'sql'; protected $namespace = '\\think\\log\\driver\\'; /** * 默認驅動 * @return string|null */ public function getDefaultDriver() { return $this->getConfig('default'); } /** * 獲取日志配置 * @access public * @param null|string $name 名稱 * @param mixed $default 默認值 * @return mixed */ public function getConfig(string $name = null, $default = null) { if (!is_null($name)) { return $this->app->config->get('log.' . $name, $default); } return $this->app->config->get('log'); } /** * 獲取渠道配置 * @param string $channel * @param null $name * @param null $default * @return array */ public function getChannelConfig($channel, $name = null, $default = null) { if ($config = $this->getConfig("channels.{$channel}")) { return Arr::get($config, $name, $default); } throw new InvalidArgumentException("Channel [$channel] not found."); } /** * driver()的別名 * @param string|array $name 渠道名 * @return Channel|ChannelSet */ public function channel($name = null) { if (is_array($name)) { return new ChannelSet($this, $name); } return $this->driver($name); } protected function resolveType(string $name) { return $this->getChannelConfig($name, 'type', 'file'); } public function createDriver(string $name) { $driver = parent::createDriver($name); $lazy = !$this->getChannelConfig($name, "realtime_write", false) && !$this->app->runningInConsole(); $allow = array_merge($this->getConfig("level", []), $this->getChannelConfig($name, "level", [])); return new Channel($name, $driver, $allow, $lazy, $this->app->event); } protected function resolveConfig(string $name) { return $this->getChannelConfig($name); } /** * 清空日志信息 * @access public * @param string|array $channel 日志通道名 * @return $this */ public function clear($channel = '*') { if ('*' == $channel) { $channel = array_keys($this->drivers); } $this->channel($channel)->clear(); return $this; } /** * 關閉本次請求日志寫入 * @access public * @param string|array $channel 日志通道名 * @return $this */ public function close($channel = '*') { if ('*' == $channel) { $channel = array_keys($this->drivers); } $this->channel($channel)->close(); return $this; } /** * 獲取日志信息 * @access public * @param string $channel 日志通道名 * @return array */ public function getLog(string $channel = null): array { return $this->channel($channel)->getLog(); } /** * 保存日志信息 * @access public * @return bool */ public function save(): bool { /** @var Channel $channel */ foreach ($this->drivers as $channel) { $channel->save(); } return true; } /** * 記錄日志信息 * @access public * @param mixed $msg 日志信息 * @param string $type 日志級別 * @param array $context 替換內容 * @param bool $lazy * @return $this */ public function record($msg, string $type = 'info', array $context = [], bool $lazy = true) { $channel = $this->getConfig('type_channel.' . $type); $this->channel($channel)->record($msg, $type, $context, $lazy); return $this; } /** * 實時寫入日志信息 * @access public * @param mixed $msg 調試信息 * @param string $type 日志級別 * @param array $context 替換內容 * @return $this */ public function write($msg, string $type = 'info', array $context = []) { return $this->record($msg, $type, $context, false); } /** * 注冊日志寫入事件監聽 * @param $listener * @return Event */ public function listen($listener) { return $this->app->event->listen(LogWrite::class, $listener); } /** * 記錄日志信息 * @access public * @param string $level 日志級別 * @param mixed $message 日志信息 * @param array $context 替換內容 * @return void */ public function log($level, $message, array $context = []): void { $this->record($message, $level, $context); } /** * 記錄emergency信息 * @access public * @param mixed $message 日志信息 * @param array $context 替換內容 * @return void */ public function emergency($message, array $context = []): void { $this->log(__FUNCTION__, $message, $context); } /** * 記錄警報信息 * @access public * @param mixed $message 日志信息 * @param array $context 替換內容 * @return void */ public function alert($message, array $context = []): void { $this->log(__FUNCTION__, $message, $context); } /** * 記錄緊急情況 * @access public * @param mixed $message 日志信息 * @param array $context 替換內容 * @return void */ public function critical($message, array $context = []): void { $this->log(__FUNCTION__, $message, $context); } /** * 記錄錯誤信息 * @access public * @param mixed $message 日志信息 * @param array $context 替換內容 * @return void */ public function error($message, array $context = []): void { $this->log(__FUNCTION__, $message, $context); } /** * 記錄warning信息 * @access public * @param mixed $message 日志信息 * @param array $context 替換內容 * @return void */ public function warning($message, array $context = []): void { $this->log(__FUNCTION__, $message, $context); } /** * 記錄notice信息 * @access public * @param mixed $message 日志信息 * @param array $context 替換內容 * @return void */ public function notice($message, array $context = []): void { $this->log(__FUNCTION__, $message, $context); } /** * 記錄一般信息 * @access public * @param mixed $message 日志信息 * @param array $context 替換內容 * @return void */ public function info($message, array $context = []): void { $this->log(__FUNCTION__, $message, $context); } /** * 記錄調試信息 * @access public * @param mixed $message 日志信息 * @param array $context 替換內容 * @return void */ public function debug($message, array $context = []): void { $this->log(__FUNCTION__, $message, $context); } /** * 記錄sql信息 * @access public * @param mixed $message 日志信息 * @param array $context 替換內容 * @return void */ public function sql($message, array $context = []): void { $this->log(__FUNCTION__, $message, $context); } public function __call($method, $parameters) { $this->log($method, ...$parameters); } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看