1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2024-09-27 23:41:34 +00:00

Add LogMonitor for live process output monitoring

This commit is contained in:
Kristóf Tóth 2018-05-29 18:00:57 +02:00
parent 00f2473592
commit 7e717b8829

View File

@ -3,7 +3,7 @@ from ast import literal_eval
from tornado.ioloop import IOLoop from tornado.ioloop import IOLoop
from tfw.components import IdeEventHandler, TerminalEventHandler, ProcessManagingEventHandler, BashMonitor from tfw.components import IdeEventHandler, TerminalEventHandler, ProcessManagingEventHandler, BashMonitor
from tfw.components import TerminalCommands from tfw.components import TerminalCommands, LogMonitor
from tfw.networking import MessageSender, TFWServerConnector from tfw.networking import MessageSender, TFWServerConnector
from tfw.config import TFWENV from tfw.config import TFWENV
from tfw.config.logs import logging from tfw.config.logs import logging
@ -80,8 +80,10 @@ if __name__ == '__main__':
) )
processmanager = ProcessManagingEventHandler( # Handles 'deploy' button clicks processmanager = ProcessManagingEventHandler( # Handles 'deploy' button clicks
key='processmanager', key='processmanager',
dirmonitor=ide.monitor dirmonitor=ide.monitor,
log_tail=2000
) )
LogMonitor('webservice', log_tail=2000).watch() # Sends live logs of webservice process to frontend
terminal.historymonitor.subscribe_callback(cenator) terminal.historymonitor.subscribe_callback(cenator)