mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-12-23 04:21:55 +00:00
Implement command logging as exampe for HistoryMonitor usage
This commit is contained in:
parent
a4b07e549e
commit
d88728bb71
@ -1,14 +1,17 @@
|
||||
from tornado.ioloop import IOLoop
|
||||
|
||||
from tfw.components.source_code_event_handler import SourceCodeEventHandler
|
||||
from tfw.components.terminado_event_handler import TerminadoEventHandler
|
||||
from tfw.components.process_managing_event_handler import ProcessManagingEventHandler
|
||||
from tornado.ioloop import IOLoop
|
||||
|
||||
from tfw.config import tfwenv
|
||||
from tfw.config.logs import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
ide = SourceCodeEventHandler('webide', tfwenv.WEBIDE_WD)
|
||||
terminado = TerminadoEventHandler('shell')
|
||||
terminado.historymonitor.callbacks.append(lambda hist: log.debug('User executed command: "{}"'.format(hist[-1])))
|
||||
processmanager = ProcessManagingEventHandler('processmanager', ide.monitor)
|
||||
|
||||
eventhandlers = {ide, terminado, processmanager}
|
||||
|
Loading…
Reference in New Issue
Block a user