当前位置: 首页>>代码示例>>Python>>正文


Python Logger.log_debug方法代码示例

本文整理汇总了Python中com.cloudMedia.theKuroBox.sdk.util.logger.Logger.log_debug方法的典型用法代码示例。如果您正苦于以下问题:Python Logger.log_debug方法的具体用法?Python Logger.log_debug怎么用?Python Logger.log_debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.cloudMedia.theKuroBox.sdk.util.logger.Logger的用法示例。


在下文中一共展示了Logger.log_debug方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __add_scheduler

# 需要导入模块: from com.cloudMedia.theKuroBox.sdk.util.logger import Logger [as 别名]
# 或者: from com.cloudMedia.theKuroBox.sdk.util.logger.Logger import log_debug [as 别名]
    def __add_scheduler(ruleId, kbxMethodIdentifier, second, minute, hour, dayOfMonth, month, dayOfWeek):
        '''
        second="0", minute="*", hour="*", dayOfMonth="*", month="*", dayOfWeek="*"
        '''
        try:
            uniqueName = "_".join([kbxMethodIdentifier, second, minute, hour, dayOfMonth, month, dayOfWeek])
            schedulerName = hash(uniqueName)
            
            if schedulerName not in TimerModule.SCHEDULER_ID_TRACKER:
                SchedulerService.add_cron_job(str(schedulerName),
                                              kbxTargetAppId=AppInfo.get_app_id(),
                                              kbxTargetMethod="scheduler_callback",
                                              kbxTargetModule="timer_module",
                                              second=second,
                                              minute=minute,
                                              hour=hour,
                                              dayOfMonth=dayOfMonth,
                                              month=month,
                                              dayOfWeek=dayOfWeek,
                                              kbxTargetParams={"kbxMethodIdentifier":kbxMethodIdentifier},
                                              store=False)
    
                TimerModule.SCHEDULER_ID_TRACKER[schedulerName] = [ruleId]
                TimerModule.RULE_ID_SCHEDULER_TRACKER[ruleId] = [schedulerName]
                
                Logger.log_debug("Added Timer:", schedulerName, uniqueName)
            else:
                TimerModule.SCHEDULER_ID_TRACKER[schedulerName].append(ruleId)
                TimerModule.RULE_ID_SCHEDULER_TRACKER[ruleId].append(schedulerName)

        except Exception as e:
            Logger.log_warning("Failed to add timer:", e)
开发者ID:TheStackBox,项目名称:xuansdk,代码行数:34,代码来源:timerModule.py

示例2: list_all_rules

# 需要导入模块: from com.cloudMedia.theKuroBox.sdk.util.logger import Logger [as 别名]
# 或者: from com.cloudMedia.theKuroBox.sdk.util.logger.Logger import log_debug [as 别名]
    def list_all_rules():
        offset = 0
        limit = 50

        totalCount = 1
        allRules = deque()
        while(offset < totalCount):
            try:
                result = StorageManagerService.get_data(group=Storage.STORAGE_RULE, limit=limit, offset=offset)

                result = ValueParser.get_dict(result)

                rules = ValueParser.get_list(result["data"])
                totalCount = int(result["totalRecord"])
                offset += limit

                if rules:
                    for rule in rules:
                        rule = ValueParser.get_dict(rule.get("appDataValue"))
                        allRules.append(rule)

            except Exception as e:
                Logger.log_debug("Storage.list_all_rules err: " + str(e))
                break
        return allRules
开发者ID:TheStackBox,项目名称:xuansdk,代码行数:27,代码来源:storage.py

示例3: __signal_scheduler_add_cron_job

# 需要导入模块: from com.cloudMedia.theKuroBox.sdk.util.logger import Logger [as 别名]
# 或者: from com.cloudMedia.theKuroBox.sdk.util.logger.Logger import log_debug [as 别名]
            def __signal_scheduler_add_cron_job(ruleId, hour, minute):
                try:
                    SchedulerService.add_cron_job(jobName=str(ruleId),
                                                  kbxTargetAppId=AppInfo.get_app_id(),
                                                  kbxTargetMethod="on_trigger_callback",
                                                  kbxTargetModule="controller_module",
                                                  kbxTargetParams={"ruleId":ruleId},
                                                  store=False,
                                                  hour=str(hour),
                                                  minute=str(minute))

                    self.__registeredRuleIds.add(ruleId)

                except SystemException as e:
                    Logger.log_debug(e)
开发者ID:TheStackBox,项目名称:xuansdk,代码行数:17,代码来源:triggerController.py

示例4: delete_scheduler

# 需要导入模块: from com.cloudMedia.theKuroBox.sdk.util.logger import Logger [as 别名]
# 或者: from com.cloudMedia.theKuroBox.sdk.util.logger.Logger import log_debug [as 别名]
 def delete_scheduler(ruleId):
     with TimerModule.SCHEDULER_LOCK:
         try:
             schedulerNames = TimerModule.RULE_ID_SCHEDULER_TRACKER.pop(ruleId, set({}))
             for schedulerName in schedulerNames:
                 TimerModule.SCHEDULER_ID_TRACKER[schedulerName].remove(ruleId)
                 
                 if not TimerModule.SCHEDULER_ID_TRACKER[schedulerName]:
                     SchedulerService.remove_job(str(schedulerName))
                     del(TimerModule.SCHEDULER_ID_TRACKER[schedulerName])
                     
                     Logger.log_debug("Removed Timer:", schedulerName)
 
         except Exception as e:
             Logger.log_warning("Failed to remove timer:", e)
开发者ID:TheStackBox,项目名称:xuansdk,代码行数:17,代码来源:timerModule.py

示例5: __signal_scheduler_add_interval_job

# 需要导入模块: from com.cloudMedia.theKuroBox.sdk.util.logger import Logger [as 别名]
# 或者: from com.cloudMedia.theKuroBox.sdk.util.logger.Logger import log_debug [as 别名]
            def __signal_scheduler_add_interval_job(ruleId, seconds, minutes, hours):

                kwargs = {k:v for k, v in {"seconds":seconds, "minutes":minutes, "hours":hours}.items() if v > 0}

                try:
                    SchedulerService.add_interval_job(jobName=str(ruleId),
                                                      kbxTargetAppId=AppInfo.get_app_id(),
                                                      kbxTargetMethod="on_trigger_callback",
                                                      kbxTargetModule="controller_module",
                                                      kbxTargetParams={"ruleId":ruleId},
                                                      store=False,
                                                      **kwargs)

                    self.__registeredRuleIds.add(ruleId)

                except SystemException as e:
                    Logger.log_debug(e)
开发者ID:TheStackBox,项目名称:xuansdk,代码行数:19,代码来源:triggerController.py

示例6: insert

# 需要导入模块: from com.cloudMedia.theKuroBox.sdk.util.logger import Logger [as 别名]
# 或者: from com.cloudMedia.theKuroBox.sdk.util.logger.Logger import log_debug [as 别名]
 def insert(self, stmt, bindings):
     '''
     The only different from "execute" is that this function returns lastrowid.
     '''
     with self.__rlock:
         cursor = self.__con.cursor()
         try:
             cursor.execute(stmt, bindings)
             lastrowid = cursor.lastrowid
             return lastrowid
         except Exception as e:
             Logger.log_error("Database.insert ex:", e)
             Logger.log_debug("Statement:", stmt, "bindings:", bindings)
             traceback.print_exc()
             raise e
         finally:
             cursor.close()
开发者ID:TheStackBox,项目名称:xuansdk,代码行数:19,代码来源:database.py

示例7: process_method_list

# 需要导入模块: from com.cloudMedia.theKuroBox.sdk.util.logger import Logger [as 别名]
# 或者: from com.cloudMedia.theKuroBox.sdk.util.logger.Logger import log_debug [as 别名]
        def process_method_list(methodList):
            #===================================================================
            # Basic type validation
            #===================================================================
            if not isinstance(methodList, list):
                Logger.log_error("RuleService.set_rule: 'condition' and 'execution' must be type of list.")
                Logger.log_debug("type:", type(methodList), "value:", methodList)
                raise AutomationException(11704, "List is required for both 'condition' and 'execution'")

            #===================================================================
            # Check allowed size, raise error if exceeded.
            #===================================================================
            methodListLen = len(methodList)
            if methodListLen > AppConstants.MAX_METHOD_SIZE:
                Logger.log_error("RuleService.set_rule: 'condition' and 'execution' cannot have more than", AppConstants.MAX_METHOD_SIZE, "items respectively.")
                raise AutomationException(11705, "Only a maximum of " + \
                                          str(AppConstants.MAX_METHOD_SIZE) + \
                                          " items is allowed for each 'condition' and 'execution' - given size " + \
                                          str(methodListLen),
                                          lambda text: str(AppConstants.MAX_METHOD_SIZE).join(text.split(":max_item_size:")))

            #===================================================================
            # Check if all kbxMethodIds are valid and all kbxMethodParams are list
            #===================================================================
            idValidator = NumberValidator(isRequired=True, decimalPoint=False)
            if not all([idValidator.is_valid(eachMethod["kbxMethodId"])
                        and isinstance(eachMethod["kbxMethodParams"], list)
                        for eachMethod in methodList]):
                raise AutomationException(11704, "'condition' and 'execution' have incorrect data structure.")

            #===================================================================
            # Check if all kbxParamName and kbxParamCurrentValue exists
            #===================================================================
            paramNameValidator = StringValidator(isRequired=True)
            for eachMethod in methodList:
                methodArgs = eachMethod["kbxMethodParams"]
                for methodArg in methodArgs:
                    if not paramNameValidator.is_valid(methodArg[AppConstants.ARG_NAME]):
                        raise AutomationException(11704, "'condition' and 'execution' have invalid params structure")

                    if not AppConstants.ARG_CURRENT_VALUE in methodArg:
                        methodArg[AppConstants.ARG_CURRENT_VALUE] = None
            
            return methodList
开发者ID:TheStackBox,项目名称:xuansdk,代码行数:46,代码来源:ruleService.py

示例8: execution_func

# 需要导入模块: from com.cloudMedia.theKuroBox.sdk.util.logger import Logger [as 别名]
# 或者: from com.cloudMedia.theKuroBox.sdk.util.logger.Logger import log_debug [as 别名]
 def execution_func(sceneThreadEvent, kbxMethodId, seri, **kwargs):
     try:
         if kbxMethodId == -291:
             # Delay Timer
             delayInSec = kwargs["delayInSec"]
             sceneThreadEvent.wait(delayInSec)
             seri["seriError"] = None
         else:
             # Execute method
             result = SharedMethod.call(**kwargs)
             seri["seriError"] = str(result)
             
         seri["seriStatus"] = "ok"
     
     except Exception as e:
         seri["seriStatus"] = "error"
         seri["seriError"] = str(e)
         Logger.log_debug("Execution failed, method:", kwargs["kbxMethodName"])
     
     finally:
         sceneThreadEvent.set()
开发者ID:TheStackBox,项目名称:xuansdk,代码行数:23,代码来源:sceneService.py

示例9: list_all_method_groups

# 需要导入模块: from com.cloudMedia.theKuroBox.sdk.util.logger import Logger [as 别名]
# 或者: from com.cloudMedia.theKuroBox.sdk.util.logger.Logger import log_debug [as 别名]
    def list_all_method_groups():
        offset = 0
        limit = 50

        totalCount = 1
        allMethodGroupIdPairs = {}
        while(offset < totalCount):
            try:
                result = StorageManagerService.get_data(group=Storage.STORAGE_METHOD_GROUP, limit=limit, offset=offset)
                result = ValueParser.get_dict(result)

                groups = ValueParser.get_list(result["data"])
                totalCount = int(result["totalRecord"])
                offset += limit

                if groups:
                    for group in groups:
                        allMethodGroupIdPairs[ValueParser.get_number(group["appDataKey"])] = ValueParser.get_number(group["appDataValue"])

            except Exception as e:
                Logger.log_debug("Storage.list_all_groups err: " + str(e))
                break

        return allMethodGroupIdPairs
开发者ID:TheStackBox,项目名称:xuansdk,代码行数:26,代码来源:storage.py

示例10: __receive_system_event

# 需要导入模块: from com.cloudMedia.theKuroBox.sdk.util.logger import Logger [as 别名]
# 或者: from com.cloudMedia.theKuroBox.sdk.util.logger.Logger import log_debug [as 别名]
 def __receive_system_event(self, eventObj):
     Logger.log_debug("PowerStripControllerModule.__receive_system_event: ", eventObj)
     self.send_web_server_event(eventObj["eventTag"], eventObj["eventData"])
开发者ID:TheStackBox,项目名称:xuansdk,代码行数:5,代码来源:powerStripControllerModule.py

示例11: __signal_scheduler_remove_task

# 需要导入模块: from com.cloudMedia.theKuroBox.sdk.util.logger import Logger [as 别名]
# 或者: from com.cloudMedia.theKuroBox.sdk.util.logger.Logger import log_debug [as 别名]
 def __signal_scheduler_remove_task(ruleId):
     try:
         SchedulerService.remove_job(str(ruleId))
         self.__registeredRuleIds.remove(ruleId)
     except SystemException as e:
         Logger.log_debug(e)
开发者ID:TheStackBox,项目名称:xuansdk,代码行数:8,代码来源:triggerController.py

示例12: __receive_system_event

# 需要导入模块: from com.cloudMedia.theKuroBox.sdk.util.logger import Logger [as 别名]
# 或者: from com.cloudMedia.theKuroBox.sdk.util.logger.Logger import log_debug [as 别名]
 def __receive_system_event(self, eventObj):
     Logger.log_debug("SwitchControllerModule.__receive_system_event: " + str(eventObj))
     self.send_web_server_event(eventObj["eventTag"], eventObj["eventData"])
开发者ID:TheStackBox,项目名称:xuansdk,代码行数:5,代码来源:switchControllerModule.py

示例13: __notify_ser_added

# 需要导入模块: from com.cloudMedia.theKuroBox.sdk.util.logger import Logger [as 别名]
# 或者: from com.cloudMedia.theKuroBox.sdk.util.logger.Logger import log_debug [as 别名]
 def __notify_ser_added(self, notiContent, notiLink, notiLinkLabel):
     Logger.log_debug("Scene Execution Result logged at:", notiLink)
     NotificationManagerService.dispatch_notification(text=notiContent, 
                                                      link=notiLink,
                                                      linkLabel=notiLinkLabel)
开发者ID:TheStackBox,项目名称:xuansdk,代码行数:7,代码来源:sceneExecutionResultService.py


注:本文中的com.cloudMedia.theKuroBox.sdk.util.logger.Logger.log_debug方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。