添加日志

This commit is contained in:
pengtao 2019-10-14 14:04:53 +08:00
parent bf9582b5ca
commit 5508f274a9

View File

@ -51,8 +51,10 @@ class Build_Gamelog_Config():
),"""
except Exception:
log.error(f"build context failed with {line}.", exc_info=True)
return False
with open(self.filename, 'w') as f:
f.write(f"{start}\n{content}\n{end}")
return True
def deploy_config(self):
ip_addr = self.get_ip_addr()
@ -89,8 +91,9 @@ class Build_Gamelog_Config():
def run(self):
keys = self.get_keys()
print(f"1={keys}")
data = self.split_data(keys)
print(f"2={data}")
self.build_config(data)
self.deploy_config()
if self.build_config(data):
if self.deploy_config():
log.info("deploy config 2 gamelog success!")
else:
log.error("deploy config failed!")