动态设置DEBUG模式触发值
@param int $debugId
@param int $count
@return $this
168022
protected function withDebugTriggerCount(int $debugId, int $count)
	{
		$this->debugCount[$debugId]['trigger'] = $count;
		
		return $this;
	}
318211
public function debugObject($obj, $indent = 0)
    {
        if (is_array($obj)) {
            $return = '';
            foreach ($obj as $k => $v) {
                $return .= str_repeat('&nbsp;', $indent);
                if (is_array($v)) {
                    $return .= $k . "->Array\n";
                    $return .= $this->debugObject($v, $indent + 1);
                } else {
                    $return .= $k . "->$v\n";
                }
            }
            return $return;
        }
    }
1218190
public function setDebugEnabled($debugEnabled = true)
	{
		$this->_debugEnabled = (boolean)$debugEnabled;
		if (!$this->_debugEnabled)
			$this->_debugData = null;
	}
219319
def set_debug(self, debug=1):
        
        self._check_if_ready()
        self.debug = debug
        self.main_loop.debug = debug
1259663
public function show($process, $debug)
    {
        $this->title('Switch debug mode command :');
        if ($process) {
            $this->info("\nThe debug mode is ".($debug ? 'enabled' : 'disabled')."\n");
        } else {
            $this->error("\nThe debug mode won't be switched\n");
        }
    }
214740
public function setDebugLogHandler($debug_log_handler)
    {
        if ($debug_log_handler !== null && is_callable($debug_log_handler)) {
            $this->debug_log_handler = $debug_log_handler;
        } elseif ($debug_log_handler === null) {
            $this->debug_log_handler = null;
        } else {
            throw new \InvalidArgumentException('Argument "debug_log_handler" must be a callable');
        }
    }
301866
public function deleteData( $debug = 1 )
	{
		if( $this->isFocused() )
		{
			$conditions	= $this->getConditionQuery( array() );
			$query	= "DELETE FROM ".$this->getTableName()." WHERE ".$conditions;
			return $this->dbc->Execute( $query, $debug );
		}
		return FALSE;
	}
627300
def debug(dbg=True):
    """"""
    global _debug_handler
    if dbg and _debug_handler is None:
        _debug_handler = logging.StreamHandler()
        logger.addHandler(_debug_handler)
        logger.setLevel(logging.DEBUG)
    elif not dbg and _debug_handler is not None:
        logger.removeHandler(_debug_handler)
        _debug_handler = None
        logger.setLevel(logging.WARNING)
826155
public synchronized void setDebug(boolean debug)
    {
        boolean oldDebug=_debugOn;
        if (_debugOn && !debug)
            this.message(DEBUG,"DEBUG OFF");
        _debugOn=debug;
        if (!oldDebug && debug)
            this.message(DEBUG,"DEBUG ON");
    }
649292
public function execute( $query, $debug = 1 )
	{
		if( !$this->dbc )
			$this->openConnection();
		return parent::execute( $query, $debug );
	}
145263
def debug(self, debug):
        

        yield from self._hypervisor.send("nio set_debug {name} {debug}".format(name=self._name, debug=debug))
1117475
public static void debug(boolean debug) {
        NotificationCenter.DBG =
            NotificationEffect.DBG =
            NotificationBuilder.DBG =
            NotificationEntry.DBG =
            NotificationHandler.DBG =
            NotificationRemote.DBG =
            NotificationRemoteCallback.DBG =
            NotificationLocal.DBG =
            NotificationGlobal.DBG =
            NotificationView.DBG =
            NotificationViewCallback.DBG =
            NotificationRootView.DBG =
            NotificationBoard.DBG =
            NotificationBoardCallback.DBG =
            ViewWrapper.DBG =
            ViewSwitcherWrapper.DBG =
            ChildViewManager.DBG =
            DBG = debug;
    }
697392
function set_debug($dbg = true)
    {
        $this->debug = $dbg;

        if ($this->ldap) {
            $this->ldap->config_set('debug', $dbg);
        }
    }
136003
public function count($count, $error) {
        if ($this->_exist) {
            array_push($this->_constraints, ['type' => self::COUNT, 'value' => $count, 'message' => $error]);
        }

        return $this;
    }
117981
public function run($debug = false) {
        $this->debug    = $debug;
        $rqMethod       = strtolower($_SERVER ['REQUEST_METHOD']);
        $this->rqMehtod = ucfirst($rqMethod);
        if ($rqMethod != 'Get') {
            Request::getInstance()->addJsonPostBody();
        }
        $this->format = rqst('format', $this->format);
        if (!$this->format) {
            $this->format = 'json';
        }
        $format = $this->format;
        fire('restful\startCall', time(), $format);
        $rtime     = 0;
        $timestamp = rqst('timestamp');
        //时间检测，时差正负5分钟
        if ($timestamp && preg_match('/^2\d\d\d-(1[0-2]|0[1-9])-(0[1-9]|[12]\d|3[01])\s([01][0-9]|2[0-3]):([0-5]\d):([0-5]\d)(\sGMT)?$/', $timestamp)) {
            $timestampx = @strtotime($timestamp);
            if ($timestampx !== false) {
                $rtime = $timestampx;
            }
        }
        $ctime = time();
        if (($rtime + 300) < $ctime || $rtime - 300 > $ctime) {
            $this->httpout(408, 'Request Timeout');//非法请求
        }
        //时间检测结束
        $v   = irqst('v', 1);
        $api = rqst('api');//API
        if (empty($api)) {
            $this->httpout(400, 'Miss API');
        }
        $app_key = rqst('app_key');//APPKEY
        if (empty($app_key)) {
            return $this->generateResult($format, [
                'error' => [
                    'code' => 40000,
                    'msg'  => __('miss app_key@restful')
                ]
            ]);
        }
        $apis = explode('.', $api);
        if (count($apis) != 3) {
            $this->httpout(406, __('Invalid API@restful'));
        }
        $namesapce = $apis[0];
        $module    = App::getModuleById($namesapce);
        if (!$module) {
            $this->httpout(404, __('module not found@restful'));
        }
        $cls = ucfirst($apis[1]) . 'Api';
        $cls = $namesapce . '\\api\\v' . $v . '\\' . $cls;
        if (class_exists($cls) && is_subclass_of($cls, API::class)) {
            /**@var API $clz */
            $clz = new $cls($app_key, $v);
            $ann = new \ReflectionObject($clz);
            $rm  = $this->rqMehtod;
            try {
                if ($rm != 'Get') {
                    $m = $ann->getMethod($apis[2] . $rm);
                } else {
                    $m = $ann->getMethod($apis[2]);
                }
            } catch (\Exception $mre) {
                try {
                    if ($rm != 'Get') {
                        $tmp = $ann->getMethod($apis[2]);
                        if ($tmp) {
                            $this->httpout(405, __('unsupport request methd@restful'));
                        }
                    }
                } catch (\Exception $e) {

                }
                $m = false;
            }
            if (!$m) {
                $this->httpout(404, __('api not found@restful'));
            }

            $params  = [];//请求参数用于签名
            $dparams = [];//调用参数
            $ps      = $m->getParameters();
            /**@var \ReflectionParameter $p */
            foreach ($ps as $p) {
                $name = $p->getName();
                if (rqset($name)) {
                    $dparams[ $name ] = $params[ $name ] = rqst($name);
                } else if ($p->isOptional()) {
                    $dparams[ $name ] = $p->getDefaultValue();
                } else if (isset($_FILES[ $name ])) {
                    $dparams[ $name ] = $_FILES[ $name ];
                } else {
                    return $this->generateResult($format, [
                        'error' => [
                            'code' => 40001,
                            'msg'  => __('Miss param: %s@restful', $name)
                        ]
                    ]);
                }
            }
            $sign_method = rqst('sign_method');
            if ($sign_method != 'md5' && $sign_method != 'sha1' && $sign_method != 'hmac') {
                return $this->generateResult($format, [
                    'error' => [
                        'code' => 40002,
                        'msg'  => __('unsupport sign methd@restful')
                    ]
                ]);
            }

            $appSecret = $this->secretChecker->check($app_key);
            if (!$appSecret) {
                return $this->generateResult($format, [
                    'error' => [
                        'code' => 40003,
                        'msg'  => __('invalid app_key@restful')
                    ]
                ]);
            }
            //签名
            $sign = rqst('sign');
            $args = array_merge($params, [
                'v'           => $v,
                'app_key'     => $app_key,
                'api'         => $api,
                'timestamp'   => $timestamp,
                'sign_method' => $sign_method
            ]);
            //响应格式
            if (rqset('format')) {
                $args['format'] = $format;
            }
            //会话
            $session = rqst('session');
            if (rqset('session')) {
                $args['session'] = $session;
            }
            $allreqs = Request::getInstance()->requests();
            unset($allreqs['sign']);
            if (($extra = array_diff_key($allreqs, $args))) {
                return $this->generateResult($format, [
                    'error' => [
                        'code'   => 40004,
                        'msg'    => __('unknown params@restful'),
                        'params' => array_keys($extra)
                    ]
                ]);
            }
            //开发模式
            $dev = $this->debug;
            if (!$dev) {
                //验签
                $sign1 = $this->signChecker->sign($args, $appSecret, 'sha1', true);
                if ($sign !== $sign1) {
                    return $this->generateResult($format, [
                        'error' => [
                            'code' => 40005,
                            'msg'  => __('invalid sign@restful')
                        ]
                    ]);
                }
            }

            if ($session) {// 启动了session
                (new Session($this->expire))->start($session);
                $clz->sessionId = $session;
            }

            try {
                $this->api = $api;
                fire('restful\callApi', $api, $ctime, $args);
                $clz->setup();
                $rtn = $m->invokeArgs($clz, $dparams);

                return $this->generateResult($format, $rtn);
            } catch (RestException $re) {
                return $this->generateResult($format, [
                    'error' => [
                        'code' => $re->getCode(),
                        'msg'  => $re->getMessage()
                    ]
                ]);
            } catch (HttpException $he) {
                $this->httpout($he->getCode(), $he->getMessage());
            } catch (UnauthorizedException $un) {
                $this->httpout(401);
            } catch (\PDOException $pe) {
                return $this->generateResult($format, [
                    'error' => [
                        'code' => 40006,
                        'msg'  => __('Internal Error - database')
                    ]
                ]);
            } catch (\Exception $e) {
                log_error('[' . $api . '] failed! ' . $e->getMessage() . "\n" . var_export($dparams, true), 'api');

                return $this->generateResult($format, ['error' => ['code' => 40007, 'msg' => $e->getMessage()]]);
            } finally {
                $clz->tearDown();
                fire('restful\endApi', $api, time(), $args);
            }
        }
        // Not Implemented
        $this->httpout(501);

        return null;
    }
1084854
public function setDebug($debug, $handler = null)
    {
        $this->debug         = $debug;
        $this->debug_handler = $handler;
    }
113935
public function addDebug($value)
    {
        if (!$this->isDebug()) {
            return $this;
        }

        return $this->addData(
            self::P_DEBUG,
            is_array($value) ? json_encode($value) : $value
        );
    }