diff --git a/solvable/src/event_handler_main.py b/solvable/src/event_handler_main.py index 1d05af4..e9c757a 100644 --- a/solvable/src/event_handler_main.py +++ b/solvable/src/event_handler_main.py @@ -1,4 +1,5 @@ import logging +from sys import stderr from ast import literal_eval from functools import partial from signal import signal, SIGTERM, SIGINT @@ -12,8 +13,8 @@ from tfw.builtins import LogMonitoringEventHandler, ProcessManagingEventHandler from tfw.builtins import DirectorySnapshottingEventHandler, FSMManagingEventHandler, MessageSender from tfw.components import TerminalCommands from tfw.config import TFWENV -from tfw.config.log import TFWLog from tao.config import TAOENV +from tfw.logging import Log, Logger, LogFormatter, VerboseLogFormatter LOG = logging.getLogger(__name__) @@ -114,7 +115,10 @@ class MessageFSMStepsEventHandler(FSMAwareEventHandler): def main(): # pylint: disable=unused-variable - TFWLog().start() + Logger([ + Log(stderr, LogFormatter(20)), + Log(TFWENV.LOGFILE, VerboseLogFormatter()) + ]).start() # TFW component EventHandlers (builtins, required for their respective functionalities) fsm = FSMManagingEventHandler( # TFW FSM diff --git a/solvable/src/pipe_io_main.py b/solvable/src/pipe_io_main.py index d737668..fabd772 100644 --- a/solvable/src/pipe_io_main.py +++ b/solvable/src/pipe_io_main.py @@ -1,11 +1,13 @@ import logging +from sys import stderr from signal import signal, SIGTERM, SIGINT from tornado.ioloop import IOLoop from tfw.event_handlers import EventHandlerBase from tfw.builtins import PipeIOEventHandler -from tfw.config.log import TFWLog +from tfw.config import TFWENV +from tfw.logging import Log, Logger, LogFormatter, VerboseLogFormatter from pipe_io_auxlib import ( SignMessagePipeIOEventHandler, VerifyMessagePipeIOEventHandler, @@ -18,8 +20,11 @@ LOG = logging.getLogger(__name__) if __name__ == '__main__': - # pylint: disable=pointless-string-statement - TFWLog().start() + Logger([ + Log(stderr, LogFormatter(20)), + Log(TFWENV.LOGFILE, VerboseLogFormatter()) + ]).start() + """ Creates general purpose pipes. The first parameter associates the receiving pipe with a key, which is