create file if not exists
This commit is contained in:
parent
55b5f55246
commit
8c405594f3
@ -150,7 +150,7 @@ class FSCLogger:
|
|||||||
# validate fields
|
# validate fields
|
||||||
if conf['logfile'] == "":
|
if conf['logfile'] == "":
|
||||||
invalid_fields.append('logfile')
|
invalid_fields.append('logfile')
|
||||||
|
|
||||||
|
|
||||||
if len(invalid_fields) > 0:
|
if len(invalid_fields) > 0:
|
||||||
# return an error as at least one field seems invalid
|
# return an error as at least one field seems invalid
|
||||||
@ -173,7 +173,7 @@ class FSCLogger:
|
|||||||
self.return_and_exit(Response(id=request.id, error="notification is missing its linked object."))
|
self.return_and_exit(Response(id=request.id, error="notification is missing its linked object."))
|
||||||
|
|
||||||
## Log to file
|
## Log to file
|
||||||
f = open(self.logfile, "a")
|
f = open(self.logfile, "a+")
|
||||||
f.write("Now the file has more content!")
|
f.write("Now the file has more content!")
|
||||||
f.close()
|
f.close()
|
||||||
self.log("getting data %s" % notification)
|
self.log("getting data %s" % notification)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user