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


Python Logging.logEvent方法代码示例

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


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

示例1: __init__

# 需要导入模块: from Logging import Logging [as 别名]
# 或者: from Logging.Logging import logEvent [as 别名]
class Core:
    """
        Initializes all the submodules and serves as a connection point between different modules.
    """
    
    def __init__(self, justPlots = False):
        self.__name__ = "Core"
        
        self.configManager = ConfigurationManager()
        
        # These return True of False depending on whether loading the conf was a success.
        # It should be checked if the conf was loaded successfully and failures should be logged.
        self.configManager.loadConf(CONFIG_CORE, True)
        self.configManager.loadConf(CONFIG_SETTINGS, True)
        self.configManager.loadConf(CONFIG_FORMS, True)
        self.configManager.loadConf(CONFIG_URLMAP, True)
        self.configManager.loadConf(CONFIG_MESSAGES, True)
        
        self.moduleManager = ModuleManager(self)
        self.settingsManager = SettingsManager(self)
        self.clientManager = ClientManager(self)
        self.sensorManager = SensorManager(self)
        self.deviceManager = DeviceManager(self)
        self.taskManager = TaskManager(self)
        self.messageManager = MessageManager(self)
        self.logging = Logging(self)

        if self.settingsManager.equals("plottype", "matplotlib"):
            from Plot import Plot
            self.plot = Plot(self)

        self.protocol = Protocol(self)
        if not justPlots: self.connection = Connection(self)
        if not justPlots: self.scheduler = Scheduler()
        if not justPlots: self.webServer = WebServer(self.connection.getLocalIP(), self.settingsManager.getValueByName("listenport")) # Currently binds to localhost. But this needs to be fixed so other connections can be listened to too.

    def initialize(self):
        self.logging.logDebug(self.__name__ + "." + "initialize")
        self.scheduler.initialize()
        
        startup = Startup(self)
        startup.addSensors()
        startup.addDevices()
        #startup.addTasks()
        #startup.addSensorLogging()
        #startup.addDailyPlots()
        #startup.addWeeklyPlots()
        #startup.addSensorControl()

        #modules = []

        #for moduleList in self.configManager.getConf(CONFIG_FORMS).getItem("modules", ""):
        #    modules.append(moduleList["module"])

        self.moduleManager.loadModules(self.configManager.getConf(CONFIG_FORMS).getItem("modules", ""))

        self.webServer.setUp()
    
    def quit(self):
        """
            Gives threads a signal to shut down, gives them some time to do so and then exits the program
            gracefully.
        """
        
        self.logging.logEvent("Core: Shutting down", "orange")
        self.connection.running = False
        sleep(1)
        from os import _exit
        _exit(0)
开发者ID:Urokhtor,项目名称:Naga-Automation-Suite,代码行数:71,代码来源:Core.py


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