diff --git a/lib/tfw/components/directory_monitor.py b/lib/tfw/components/directory_monitor.py index 7144f0e..65dc275 100644 --- a/lib/tfw/components/directory_monitor.py +++ b/lib/tfw/components/directory_monitor.py @@ -1,6 +1,7 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. +import logging from functools import wraps from watchdog.events import FileSystemEventHandler as FileSystemWatchdogEventHandler @@ -10,8 +11,6 @@ from tfw.event_handlers import TFWServerUplinkConnector from tfw.decorators.rate_limiter import RateLimiter from tfw.mixins.observer_mixin import ObserverMixin -from tfw.config.logs import logging - LOG = logging.getLogger(__name__) diff --git a/lib/tfw/components/directory_monitoring_event_handler.py b/lib/tfw/components/directory_monitoring_event_handler.py index 18bb8ca..222736c 100644 --- a/lib/tfw/components/directory_monitoring_event_handler.py +++ b/lib/tfw/components/directory_monitoring_event_handler.py @@ -1,12 +1,12 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. +import logging from os.path import isdir, exists from tfw.event_handlers import FrontendEventHandlerBase from tfw.mixins.monitor_manager_mixin import MonitorManagerMixin from tfw.components.directory_monitor import DirectoryMonitor -from tfw.config.logs import logging LOG = logging.getLogger(__name__) diff --git a/lib/tfw/components/directory_snapshotting_event_handler.py b/lib/tfw/components/directory_snapshotting_event_handler.py index d60732f..1e8c1ea 100644 --- a/lib/tfw/components/directory_snapshotting_event_handler.py +++ b/lib/tfw/components/directory_snapshotting_event_handler.py @@ -1,6 +1,7 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. +import logging from os.path import join as joinpath from os.path import basename from os import makedirs @@ -11,7 +12,6 @@ from dateutil import parser as dateparser from tfw.event_handlers import FrontendEventHandlerBase from tfw.components.snapshot_provider import SnapshotProvider from tfw.config import TFWENV -from tfw.config.logs import logging LOG = logging.getLogger(__name__) diff --git a/lib/tfw/components/fsm_managing_event_handler.py b/lib/tfw/components/fsm_managing_event_handler.py index ac6e6fc..4860f5a 100644 --- a/lib/tfw/components/fsm_managing_event_handler.py +++ b/lib/tfw/components/fsm_managing_event_handler.py @@ -1,9 +1,10 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. +import logging + from tfw.event_handlers import FrontendEventHandlerBase from tfw.crypto import KeyManager, sign_message, verify_message -from tfw.config.logs import logging from tfw.networking import Scope LOG = logging.getLogger(__name__) diff --git a/lib/tfw/components/ide_event_handler.py b/lib/tfw/components/ide_event_handler.py index 2632b45..da32cda 100644 --- a/lib/tfw/components/ide_event_handler.py +++ b/lib/tfw/components/ide_event_handler.py @@ -1,6 +1,7 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. +import logging from os.path import isfile, join, relpath, exists, isdir, realpath from glob import glob from fnmatch import fnmatchcase @@ -9,7 +10,6 @@ from typing import Iterable from tfw.event_handlers import FrontendEventHandlerBase from tfw.mixins.monitor_manager_mixin import MonitorManagerMixin from tfw.components.directory_monitor import DirectoryMonitor -from tfw.config.logs import logging LOG = logging.getLogger(__name__) diff --git a/lib/tfw/components/log_monitoring_event_handler.py b/lib/tfw/components/log_monitoring_event_handler.py index 23fe5b9..e324786 100644 --- a/lib/tfw/components/log_monitoring_event_handler.py +++ b/lib/tfw/components/log_monitoring_event_handler.py @@ -1,10 +1,11 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. +import logging + from tfw.event_handlers import FrontendEventHandlerBase from tfw.mixins.monitor_manager_mixin import MonitorManagerMixin from tfw.components.log_monitor import LogMonitor -from tfw.config.logs import logging LOG = logging.getLogger(__name__) diff --git a/lib/tfw/components/pipe_io_event_handler.py b/lib/tfw/components/pipe_io_event_handler.py index e35455e..da3e726 100644 --- a/lib/tfw/components/pipe_io_event_handler.py +++ b/lib/tfw/components/pipe_io_event_handler.py @@ -1,3 +1,4 @@ +import logging from abc import abstractmethod from json import loads, dumps from subprocess import run, PIPE, Popen @@ -10,7 +11,6 @@ from threading import Thread from contextlib import suppress from tfw.event_handlers import EventHandlerBase -from tfw.config.logs import logging from .pipe_io_server import PipeIOServer, terminate_process_on_failure diff --git a/lib/tfw/components/process_managing_event_handler.py b/lib/tfw/components/process_managing_event_handler.py index f6489e6..37141d0 100644 --- a/lib/tfw/components/process_managing_event_handler.py +++ b/lib/tfw/components/process_managing_event_handler.py @@ -1,12 +1,12 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. +import logging from xmlrpc.client import Fault as SupervisorFault from tfw.event_handlers import FrontendEventHandlerBase from tfw.mixins.supervisor_mixin import SupervisorMixin, SupervisorLogMixin from tfw.components.directory_monitor import with_monitor_paused -from tfw.config.logs import logging LOG = logging.getLogger(__name__) diff --git a/lib/tfw/components/terminado_mini_server.py b/lib/tfw/components/terminado_mini_server.py index 0f77c34..a440e23 100644 --- a/lib/tfw/components/terminado_mini_server.py +++ b/lib/tfw/components/terminado_mini_server.py @@ -1,12 +1,13 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. +import logging + from tornado.ioloop import IOLoop from tornado.web import Application from terminado import TermSocket, SingleTermManager from tfw.config import TFWENV -from tfw.config.logs import logging LOG = logging.getLogger(__name__) diff --git a/lib/tfw/components/terminal_commands.py b/lib/tfw/components/terminal_commands.py index 14563bd..9a55d22 100644 --- a/lib/tfw/components/terminal_commands.py +++ b/lib/tfw/components/terminal_commands.py @@ -1,12 +1,11 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. +import logging from abc import ABC from re import match from shlex import split -from tfw.config.logs import logging - LOG = logging.getLogger(__name__) diff --git a/lib/tfw/components/terminal_event_handler.py b/lib/tfw/components/terminal_event_handler.py index 3427c4f..436247f 100644 --- a/lib/tfw/components/terminal_event_handler.py +++ b/lib/tfw/components/terminal_event_handler.py @@ -1,10 +1,11 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. +import logging + from tfw.event_handlers import FrontendEventHandlerBase from tfw.components.terminado_mini_server import TerminadoMiniServer from tfw.config import TFWENV -from tfw.config.logs import logging from tao.config import TAOENV LOG = logging.getLogger(__name__) diff --git a/lib/tfw/config/logs.py b/lib/tfw/config/logs.py deleted file mode 100644 index 15992b2..0000000 --- a/lib/tfw/config/logs.py +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (C) 2018 Avatao.com Innovative Learning Kft. -# All Rights Reserved. See LICENSE file for details. - -import logging - -logging.basicConfig(level=logging.DEBUG) diff --git a/lib/tfw/event_handlers/event_handler_base.py b/lib/tfw/event_handlers/event_handler_base.py index 0cc0a9e..d5bb20e 100644 --- a/lib/tfw/event_handlers/event_handler_base.py +++ b/lib/tfw/event_handlers/event_handler_base.py @@ -1,12 +1,11 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. +import logging from abc import ABC, abstractmethod from inspect import currentframe from typing import Iterable -from tfw.config.logs import logging - from .tfw_server_connector import TFWServerConnector LOG = logging.getLogger(__name__) diff --git a/lib/tfw/event_handlers/fsm_aware.py b/lib/tfw/event_handlers/fsm_aware.py index 13cea43..ddbf6fb 100644 --- a/lib/tfw/event_handlers/fsm_aware.py +++ b/lib/tfw/event_handlers/fsm_aware.py @@ -1,8 +1,9 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. +import logging + from tfw.crypto import KeyManager, verify_message -from tfw.config.logs import logging LOG = logging.getLogger(__name__) diff --git a/lib/tfw/fsm/fsm_base.py b/lib/tfw/fsm/fsm_base.py index d9fff29..5b050e0 100644 --- a/lib/tfw/fsm/fsm_base.py +++ b/lib/tfw/fsm/fsm_base.py @@ -1,13 +1,13 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. +import logging from collections import defaultdict from datetime import datetime from transitions import Machine, MachineError from tfw.mixins.callback_mixin import CallbackMixin -from tfw.config.logs import logging LOG = logging.getLogger(__name__) diff --git a/lib/tfw/mixins/monitor_manager_mixin.py b/lib/tfw/mixins/monitor_manager_mixin.py index f247659..c153ff9 100644 --- a/lib/tfw/mixins/monitor_manager_mixin.py +++ b/lib/tfw/mixins/monitor_manager_mixin.py @@ -1,7 +1,7 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. -from tfw.config.logs import logging +import logging LOG = logging.getLogger(__name__) diff --git a/lib/tfw/networking/event_handler_connector.py b/lib/tfw/networking/event_handler_connector.py index 378db11..e9b2511 100644 --- a/lib/tfw/networking/event_handler_connector.py +++ b/lib/tfw/networking/event_handler_connector.py @@ -1,11 +1,11 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. +import logging + import zmq from zmq.eventloop.zmqstream import ZMQStream -from tfw.config.logs import logging - from .serialization import serialize_tfw_msg, with_deserialize_tfw_msg LOG = logging.getLogger(__name__) diff --git a/lib/tfw/networking/server_connector.py b/lib/tfw/networking/server_connector.py index 6bee301..dc3c78c 100644 --- a/lib/tfw/networking/server_connector.py +++ b/lib/tfw/networking/server_connector.py @@ -1,13 +1,12 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. +import logging from functools import partial import zmq from zmq.eventloop.zmqstream import ZMQStream -from tfw.config.logs import logging - from .scope import Scope from .serialization import serialize_tfw_msg, with_deserialize_tfw_msg diff --git a/lib/tfw/server/tfw_server.py b/lib/tfw/server/tfw_server.py index ad2d37e..a7f7804 100644 --- a/lib/tfw/server/tfw_server.py +++ b/lib/tfw/server/tfw_server.py @@ -1,11 +1,12 @@ # Copyright (C) 2018 Avatao.com Innovative Learning Kft. # All Rights Reserved. See LICENSE file for details. +import logging + from tornado.web import Application from tfw.networking import EventHandlerConnector from tfw.config import TFWENV -from tfw.config.logs import logging from .zmq_websocket_router import ZMQWebSocketRouter diff --git a/lib/tfw/server/zmq_websocket_router.py b/lib/tfw/server/zmq_websocket_router.py index d6021b6..8ad0905 100644 --- a/lib/tfw/server/zmq_websocket_router.py +++ b/lib/tfw/server/zmq_websocket_router.py @@ -2,11 +2,11 @@ # All Rights Reserved. See LICENSE file for details. import json +import logging from tornado.websocket import WebSocketHandler from tfw.networking import Scope -from tfw.config.logs import logging LOG = logging.getLogger(__name__) diff --git a/supervisor/tfw_server.py b/supervisor/tfw_server.py index a3848b6..0d52bbf 100644 --- a/supervisor/tfw_server.py +++ b/supervisor/tfw_server.py @@ -1,7 +1,11 @@ +import logging + from tornado.ioloop import IOLoop from tfw.server import TFWServer +logging.basicConfig(level=logging.DEBUG) + if __name__ == '__main__': TFWServer().listen()