1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

python add more logging

This commit is contained in:
Steffen Vogel 2018-11-30 20:45:30 +01:00
parent 96b3147766
commit 640acafbce
2 changed files with 6 additions and 2 deletions

View file

@ -1 +1 @@
import .node
from . import node

View file

@ -37,23 +37,27 @@ class Node(object):
self.log = open(self.log_filename, 'w+')
LOGGER.info("Starting VILLASnode with config: %s", self.config_file.name)
LOGGER.info("Starting VILLASnode instance with config: %s", self.config_file.name)
self.child = subprocess.Popen([self.executable, self.config_file.name], stdout=self.log, stderr=self.log)
def pause(self):
LOGGER.info("Pausing VILLASnode instance")
self.child.send_signal(signal.SIGSTOP)
def resume(self):
LOGGER.info("Resuming VILLASnode instance")
self.child.send_signal(signal.SIGCONT)
def stop(self):
LOGGER.info("Stopping VILLASnode instance")
self.child.send_signal(signal.SIGTERM)
self.child.wait()
self.log.close()
def restart(self):
LOGGER.info("Restarting VILLASnode instance")
self.request('restart')
@property