mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2024-11-15 01:27:18 +00:00
Refactor TFW logging
This commit is contained in:
parent
b392749643
commit
8590aba8dd
@ -1,4 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
|
from sys import stderr
|
||||||
from ast import literal_eval
|
from ast import literal_eval
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from signal import signal, SIGTERM, SIGINT
|
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.builtins import DirectorySnapshottingEventHandler, FSMManagingEventHandler, MessageSender
|
||||||
from tfw.components import TerminalCommands
|
from tfw.components import TerminalCommands
|
||||||
from tfw.config import TFWENV
|
from tfw.config import TFWENV
|
||||||
from tfw.config.log import TFWLog
|
|
||||||
from tao.config import TAOENV
|
from tao.config import TAOENV
|
||||||
|
from tfw.logging import Log, Logger, LogFormatter, VerboseLogFormatter
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -114,7 +115,10 @@ class MessageFSMStepsEventHandler(FSMAwareEventHandler):
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
# pylint: disable=unused-variable
|
# 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)
|
# TFW component EventHandlers (builtins, required for their respective functionalities)
|
||||||
fsm = FSMManagingEventHandler( # TFW FSM
|
fsm = FSMManagingEventHandler( # TFW FSM
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
import logging
|
import logging
|
||||||
|
from sys import stderr
|
||||||
from signal import signal, SIGTERM, SIGINT
|
from signal import signal, SIGTERM, SIGINT
|
||||||
|
|
||||||
from tornado.ioloop import IOLoop
|
from tornado.ioloop import IOLoop
|
||||||
|
|
||||||
from tfw.event_handlers import EventHandlerBase
|
from tfw.event_handlers import EventHandlerBase
|
||||||
from tfw.builtins import PipeIOEventHandler
|
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 (
|
from pipe_io_auxlib import (
|
||||||
SignMessagePipeIOEventHandler, VerifyMessagePipeIOEventHandler,
|
SignMessagePipeIOEventHandler, VerifyMessagePipeIOEventHandler,
|
||||||
@ -18,8 +20,11 @@ LOG = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# pylint: disable=pointless-string-statement
|
Logger([
|
||||||
TFWLog().start()
|
Log(stderr, LogFormatter(20)),
|
||||||
|
Log(TFWENV.LOGFILE, VerboseLogFormatter())
|
||||||
|
]).start()
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Creates general purpose pipes.
|
Creates general purpose pipes.
|
||||||
The first parameter associates the receiving pipe with a key, which is
|
The first parameter associates the receiving pipe with a key, which is
|
||||||
|
Loading…
Reference in New Issue
Block a user