记录同一 session 下的debug日志

@param string $name
519529
public static function debugSession($name = "") {

        $session_id = request()->session()->sessionId();
        $sessionIds = Cache::get(md5('Log.debugSession'), []);
        $sessionIds[ $session_id ] = $name;
        Cache::set(md5('Log.debugSession'), $sessionIds);
    }
33987
public function get($name) {
        N('cache_read',1);
        $value = $this->handler->get($this->options['prefix'].$name);
        $jsonData  = json_decode( $value, true );
        return ($jsonData === NULL) ? $value : $jsonData;	//检测是否为JSON数据 true 返回JSON解析数组, false返回源数据
    }
1304306
public function execute($name, $data, Session $session)
    {
        switch ($name) {
            case 'query:post':
                $this->data['time'] += $data['time_ms'];
                $data += array_pop($this->data['queries']);
            case 'query:pre':
                $this->data['queries'][] = $data;
                break;
        }

        $this->watch($name);
    }
375277
public function disconnect($name = '')
    {
        if (empty($name)) {
            $name = $this->dbName;
        }
        try {
            $this->db->disconnect($name);
            unset($this->db);
        }
        catch (\Exception $e) {
            $this->debug->error(__FUNCTION__, $e->getFile() . ' - Line: ' . $e->getLine() . ' - Message: ' . $e->getMessage());

            return NULL;
        }
    }
1046257
public static function init($path, $name = 'log', $minimumLevel = self::DEBUG)
    {
        if($path === 'php://output')
        {
            self::$active = true;
        }
        else if(is_writable($path))
        {
            self::$active = true;
        }
        else 
        {
            self::$active = false;
        }
        
        self::$backend = null;
        self::$stream = null;
        self::$name = $name;
        self::$logFilePath = $path;
        self::$minimumLevel = $minimumLevel;
    }
873898
static public function logger($name=null)
	{
	    $id = 'logger' . ( isset($name) ? '.' . $name : '' );
	    if (!static::has($id)) {
	        static::setShared($id, function () use ($name) {
	            // common config
	            $options = Config::getCommon('log') ?: [];
	            
	            // compoment level config
	            if ($name) {
	                $name = str_replace(['\\', '//'], '/', $name);
	                
	                $name = explode('/', $name, 2);
	                if ($name[0] == 'db') {
	                    $name[0] = 'database';
	                }
	                $fname = $name[0];
	                $name = implode('/', $name);
	                
	                $m_options = Config::getByType('log', $fname);
	                
	                if (!isset($m_options['path']) && !isset($m_options['group'])) {
	                    $options['group'] = $name; // group取name, 支持目录式设置如 'db/sql'
	                }
	                if ($m_options) {
	                    $options = ArrayHelper::merge($options, $m_options);
	                }
	            }
	            
	            $options['path'] = isset($options['path']) ? ltrim($options['path'], '/') : 'logs';
	            $options['path'] = Config::getStoragePath() . $options['path'];
	            
	            return new Logger($options);
	        });
	    }
	    return static::get($id);
	}
321206
function loadFromSession($name = '') {
		if(!$name) $name = $this->owner->FormName();

		$formSession = \Session::get("FormInfo.{$name}.data");
		if($formSession) $this->owner->loadDataFrom($formSession);
	}
19209
public function deleteByKey($name) : void
    {
        if(!$this->keyExists($name)) {
            return;
        }

        parent::deleteByKey($name);
        unset($_SESSION[$name]);
    }
1338670
public function setName(string $name) : void
    {
        $data = (object)[
            'threadNameDetail' => (object)[
                'threadName' => $name
            ]
        ];

        $this->putJson(sprintf(self::MESSAGE_THREAD_ENDPOINT . 'threads/%s/name', $this->messageThreadId), $data);
    }
115200
public function get($name)
    {
        // 未加载数据,已登录,session中存在需要的key
        if (!$this->isLoaded() && isset($this->session['user'][$name])) {
            return $this->session['user'][$name];
        } else {
            $this->loadDbUser();

            return parent::get($name);
        }
    }
52853
public function __isset($name)
    {
        // 存在字段映射，则被映射的对象属性必能访问
        if($this->columnMap && key_exists($name, $this->columnMap)) {
            // 显式声明属性名
            $attr = $this->columnMap[$name];
            return !is_null($this->$attr);
        }

        return key_exists($name, $this->attrs);
    }
987862
public function configure($name)
    {
        if (isset($this->loadedConfigurations[$name])) {
            return;
        }
        //标记为已加载
        $this->loadedConfigurations[$name] = true;
        $path = $this->getConfigurationPath($name);
        if ($path) {
            $this->make('config')->set($name, require $path);
        }
    }
565485
public function reconnect($name)
    {
        if (isset($this->connections[$name])) {
            $this->disconnect($name);
            $this->usePdo($name);
        }
    }
1294648
public function execDown(string $name): void{
        $this->down();
        DB::connection('default')->table('migrations')->where('name', $name)->delete();
    }
955601
public void addLog(final String name) {
        ErrorLogger log = new ErrorLogger(name);
        logs.put(name, log);
        log.setVerboseDebug(debugLevel);
    }
773381
public function setDefaultHandler($name)
    {
        if (!array_key_exists($name, $this->logRegistry)) {
            throw new \Exception('LogHandler named ['.$name.'] does not exist');
        }
        $this->defaultLogHandler = $name;
    }
1214998
public function registerEvent(string $name, ?string $table = null, \Closure $action): void
    {
        $this->connection->getEventHandler()->registerEvent($name, $table, $action);
    }