1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2025-07-07 05:06:23 +00:00

Refactor TFW logging

This commit is contained in:
R. Richard
2019-06-28 17:36:03 +02:00
parent b392749643
commit 8590aba8dd
2 changed files with 14 additions and 5 deletions

View File

@ -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