mirror of
https://github.com/ThomasGsp/HyperProxmox.git
synced 2025-03-09 15:40:18 +00:00
- Test log dir.
This commit is contained in:
parent
d280ab6bfc
commit
640334893d
1 changed files with 17 additions and 13 deletions
|
@ -113,6 +113,7 @@ class Logger2:
|
||||||
|
|
||||||
text = "[{date}] {info} : {text} \n".format(date=date, info=info, text=text)
|
text = "[{date}] {info} : {text} \n".format(date=date, info=info, text=text)
|
||||||
|
|
||||||
|
try:
|
||||||
if json_text["type"] == "PROXMOX":
|
if json_text["type"] == "PROXMOX":
|
||||||
errorlog = open("{0}/proxmox.log".format(self.logs_dir), "ab")
|
errorlog = open("{0}/proxmox.log".format(self.logs_dir), "ab")
|
||||||
errorlog.write(text.encode('utf-8'))
|
errorlog.write(text.encode('utf-8'))
|
||||||
|
@ -125,5 +126,8 @@ class Logger2:
|
||||||
else:
|
else:
|
||||||
errorlog = open("{0}/others.log".format(self.logs_dir), "ab")
|
errorlog = open("{0}/others.log".format(self.logs_dir), "ab")
|
||||||
errorlog.write(text.encode('utf-8'))
|
errorlog.write(text.encode('utf-8'))
|
||||||
|
|
||||||
errorlog.close()
|
errorlog.close()
|
||||||
|
except BaseException:
|
||||||
|
print("Cannot write on {0}, please check permissions.".format(self.logs_dir))
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue