标签:handle with spl 路径 dir 查找 col strip 怎么
处理log时遇到一些东东
dip write
,就详细分析,但会拿到 a_dip write
,怎么办?dip write
in line 改成了 if line.startswith(‘dip write‘)size=10
和 bgm=history
改写成dict with open('/mnt/test_annie/test.log', 'r') as f:
for line in f.readlines()[1:]:
# for line in f.readlines():
if line.startswith('dip write'):
useful_list = line.split(' ')
new_file_from_log = eval(useful_list[-1].strip())
for item in useful_list:
if '=' in item:
item = dict(urlparse.parse_qsl(item))
checkpoint_log = dict(checkpoint_log.items() + item.items())
before_num_file = len(self.instance.files) new_file_path = sorted(self.instance.files.keys())[-1] new_file_size = os.path.getsize(new_file_path)
cls.fh = logging.FileHandler('/mnt/test_annie/test.log')
cls.instance.logger.addHandler(cls.fh)
标签:handle with spl 路径 dir 查找 col strip 怎么
原文地址:https://www.cnblogs.com/vivivi/p/12111634.html