diff --git a/src/core/command/console.py b/src/core/command/console.py index 5ff82ed876322dfe35684228a25c6c82d978b90e..2aa87393578cc0106064b884929dbcbe9d792137 100755 --- a/src/core/command/console.py +++ b/src/core/command/console.py @@ -260,6 +260,13 @@ class Console(object): help="Specify part deps", choices=["partdeps"] ) + parser.add_argument("-hg", "--hilogswitch", + action="store", + type=str, + dest="hilogswitch", + default=True, + help="The console does not print operation hilog logs" + ) # 解析部分命令行参数,会返回一个由两个条目构成的元组,其中包含带成员的命名空间(options)和剩余参数字符串的列表(unparsed) cls._params_pre_processing(para_list) diff --git a/src/core/driver/drivers.py b/src/core/driver/drivers.py index 80f00da2e4a96ac589b849735fa7b42f31c45bf8..b27bf6e4811ec72281b77c6a88115bde677abb54 100644 --- a/src/core/driver/drivers.py +++ b/src/core/driver/drivers.py @@ -577,8 +577,10 @@ class CppTestDriver(IDriver): result.make_empty_result_file( "No test device is found. ") return + self.config.device.set_device_report_path(request.config.report_path) - self.config.device.device_log_collector.start_hilog_task() + if request.config.hilogswitch != "0": + self.config.device.device_log_collector.start_hilog_task() self._init_gtest() self._run_gtest(suite_file) @@ -592,8 +594,9 @@ class CppTestDriver(IDriver): log_tar_file_name = "{}_{}".format(request.get_module_name(), str(serial).replace( ":", "_")) try: - self.config.device.device_log_collector.stop_hilog_task( - log_tar_file_name, module_name=request.get_module_name()) + if request.config.hilogswitch != "0": + self.config.device.device_log_collector.stop_hilog_task( + log_tar_file_name, module_name=request.get_module_name()) finally: update_xml(request.root.source.source_file, xml_path)