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


Python LoggerSetup.shutdown方法代码示例

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


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

示例1: test_add_handler

# 需要导入模块: from log.loggersetup import LoggerSetup [as 别名]
# 或者: from log.loggersetup.LoggerSetup import shutdown [as 别名]
 def test_add_handler(self):
     LoggerSetup.setup()
     name = subprocess.getoutput('tty')
     result = LoggerSetup.add_handler(name)
     self.assertEqual(True, result)
     logging.info('Info on all cli')
     result = LoggerSetup.add_handler(name)
     self.assertEqual(False, result)
     LoggerSetup.shutdown()
开发者ID:PumucklOnTheAir,项目名称:TestFramework,代码行数:11,代码来源:test_AP_Logger.py

示例2: test_close

# 需要导入模块: from log.loggersetup import LoggerSetup [as 别名]
# 或者: from log.loggersetup.LoggerSetup import shutdown [as 别名]
    def test_close(self):
        """
        Tests close
        :return: Tests results
        """
        LoggerSetup.setup()
        LoggerSetup.shutdown()

        self.assertEqual(False, LoggerSetup.is_setup_loaded())
开发者ID:PumucklOnTheAir,项目名称:TestFramework,代码行数:11,代码来源:test_AP_Logger.py

示例3: test_is_loaded

# 需要导入模块: from log.loggersetup import LoggerSetup [as 别名]
# 或者: from log.loggersetup.LoggerSetup import shutdown [as 别名]
    def test_is_loaded(self):
        """
        Tests is loaded
        :return: Tests results
        """
        LoggerSetup.setup()
        result = LoggerSetup.is_setup_loaded()
        LoggerSetup.shutdown()

        self.assertEqual(True, result)
开发者ID:PumucklOnTheAir,项目名称:TestFramework,代码行数:12,代码来源:test_AP_Logger.py

示例4: test_debug_level

# 需要导入模块: from log.loggersetup import LoggerSetup [as 别名]
# 或者: from log.loggersetup.LoggerSetup import shutdown [as 别名]
    def test_debug_level(self):
        """
        Test debug level
        :return: Test results
        """
        LoggerSetup.setup(10, "logger.log", "", 5, None)
        deep = LoggerSetup._max_log_deep
        LoggerSetup.shutdown()

        self.assertEqual(True, deep == 5)
开发者ID:PumucklOnTheAir,项目名称:TestFramework,代码行数:12,代码来源:test_AP_Logger.py

示例5: test_setup

# 需要导入模块: from log.loggersetup import LoggerSetup [as 别名]
# 或者: from log.loggersetup.LoggerSetup import shutdown [as 别名]
    def test_setup(self):
        """
        Tests setup
        :return: Tests results
        """

        LoggerSetup.setup(10)

        self.assertEqual(True, LoggerSetup.is_setup_loaded())

        LoggerSetup.shutdown()
开发者ID:PumucklOnTheAir,项目名称:TestFramework,代码行数:13,代码来源:test_AP_Logger.py

示例6: test_info

# 需要导入模块: from log.loggersetup import LoggerSetup [as 别名]
# 或者: from log.loggersetup.LoggerSetup import shutdown [as 别名]
    def test_info(self):
        """
        Tests info
        :return: Tests results
        """
        LoggerSetup.setup(10)

        logging.info("Info")

        self.assertEqual(True, LoggerSetup.is_setup_loaded())

        LoggerSetup.shutdown()
开发者ID:PumucklOnTheAir,项目名称:TestFramework,代码行数:14,代码来源:test_AP_Logger.py

示例7: test_critical

# 需要导入模块: from log.loggersetup import LoggerSetup [as 别名]
# 或者: from log.loggersetup.LoggerSetup import shutdown [as 别名]
    def test_critical(self):
        """
        Tests critical
        :return: Tests results
        """
        LoggerSetup.setup(10)

        logging.critical("Critical")

        self.assertEqual(True, LoggerSetup.is_setup_loaded())

        LoggerSetup.shutdown()
开发者ID:PumucklOnTheAir,项目名称:TestFramework,代码行数:14,代码来源:test_AP_Logger.py

示例8: test_error

# 需要导入模块: from log.loggersetup import LoggerSetup [as 别名]
# 或者: from log.loggersetup.LoggerSetup import shutdown [as 别名]
    def test_error(self):
        """
        Tests error
        :return: Tests results
        """
        LoggerSetup.setup(10)

        logging.error("Error")

        self.assertEqual(True, LoggerSetup.is_setup_loaded())

        LoggerSetup.shutdown()
开发者ID:PumucklOnTheAir,项目名称:TestFramework,代码行数:14,代码来源:test_AP_Logger.py

示例9: test_warning

# 需要导入模块: from log.loggersetup import LoggerSetup [as 别名]
# 或者: from log.loggersetup.LoggerSetup import shutdown [as 别名]
    def test_warning(self):
        """
        Tests warning
        :return: Tests results
        """
        LoggerSetup.setup(10)

        logging.warning("Warning")

        self.assertEqual(True, LoggerSetup.is_setup_loaded())

        LoggerSetup.shutdown()
开发者ID:PumucklOnTheAir,项目名称:TestFramework,代码行数:14,代码来源:test_AP_Logger.py

示例10: test_debug

# 需要导入模块: from log.loggersetup import LoggerSetup [as 别名]
# 或者: from log.loggersetup.LoggerSetup import shutdown [as 别名]
    def test_debug(self):
        """
        Tests debug
        :return: Tests results
        """
        LoggerSetup.setup(10)

        logging.debug("Debug")

        self.assertEqual(True, LoggerSetup.is_setup_loaded())

        LoggerSetup.shutdown()
开发者ID:PumucklOnTheAir,项目名称:TestFramework,代码行数:14,代码来源:test_AP_Logger.py

示例11: test_log_level_tab

# 需要导入模块: from log.loggersetup import LoggerSetup [as 别名]
# 或者: from log.loggersetup.LoggerSetup import shutdown [as 别名]
    def test_log_level_tab(self):
        """
        Test log level tab
        :return: Test results
        """
        LoggerSetup.setup(10)

        logging.info("%sInfo deep 2", LoggerSetup.get_log_deep(2))
        logging.info("%sInfo deep 3 with - as char", LoggerSetup.get_log_deep(3, '-'))

        self.assertEqual(True, LoggerSetup.is_setup_loaded())

        LoggerSetup.shutdown()
开发者ID:PumucklOnTheAir,项目名称:TestFramework,代码行数:15,代码来源:test_AP_Logger.py

示例12: test_multiprocessing

# 需要导入模块: from log.loggersetup import LoggerSetup [as 别名]
# 或者: from log.loggersetup.LoggerSetup import shutdown [as 别名]
    def test_multiprocessing(self):
        """
        Tests the logging from different Processes
        :return: Test result
        """

        LoggerSetup.setup()

        p1 = Process(target=worker1)
        p2 = Process(target=worker2)
        p1.start()
        p2.start()
        x = 10
        while x > 0:
            logging.info('Info from main {0}'.format(x))
            time.sleep(0.25)
            x -= 1

        p1.join()
        p2.join()

        LoggerSetup.shutdown()

        self.assertEqual(True, True)
开发者ID:PumucklOnTheAir,项目名称:TestFramework,代码行数:26,代码来源:test_AP_Logger.py

示例13: _close_wait

# 需要导入模块: from log.loggersetup import LoggerSetup [as 别名]
# 或者: from log.loggersetup.LoggerSetup import shutdown [as 别名]
    def _close_wait(cls) -> None:
        assert(cls._pid == os.getpid())

        cls._server_stop_event.wait()

        if cls._stopped.acquire(blocking=False, timeout=-1):
            print("Shutdown server")
            cls._stopped = True
            cls._task_pool.close()

            try:
                with shelve.open('test_results', 'c') as db:
                    # Record test values
                    db.clear()
                    for i, t in enumerate(cls._test_results):
                        dbt = DBTestResult()
                        dbt.router_id = t[0]
                        dbt.test_name = t[1]
                        dbt.failures = t[2].failures
                        dbt.errors = t[2].errors
                        dbt.testsRun = t[2].testsRun
                        db[str(i)] = dbt
            except Exception as e:
                logging.error("Error at write test results into DB: {0}".format(e))

            cls._task_pool.terminate()
            cls._task_pool.join()
            cls._task_wait_executor.shutdown(wait=False)
            if cls.VLAN:
                cls._nv_assistent.close()

            cls._ipc_server.shutdown()

            # close open streams and the logger instance
            LoggerSetup.shutdown()
            sys.exit(0)
开发者ID:PumucklOnTheAir,项目名称:TestFramework,代码行数:38,代码来源:server.py


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