修改L2设备日志抓取逻辑代码错误

Signed-off-by: deveco_xdevice <liguangjie1@huawei.com>
This commit is contained in:
deveco_xdevice 2023-01-17 11:37:49 +08:00
parent e3e1b9ef9f
commit 72a394228f

View File

@ -862,3 +862,16 @@ class DeviceLogCollector:
cur_time = get_cst_time().strftime(iso_time_format)
self.device.execute_shell_command("date '{}'".format(cur_time))
self.device.execute_shell_command("hwclock --systohc")
def add_log_address(self, log_file_address, hilog_file_address):
# record to restart catch log when reboot device
if log_file_address:
self.log_file_address.append(log_file_address)
if hilog_file_address:
self.hilog_file_address.append(hilog_file_address)
def remove_log_address(self, log_file_address, hilog_file_address):
if log_file_address:
self.log_file_address.remove(log_file_address)
if hilog_file_address:
self.hilog_file_address.remove(hilog_file_address)