summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/backend
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2015-06-12 14:34:18 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2015-06-22 15:52:37 -0300
commit32658ae3108bc67a102cf6e0153d468b3a8ae1b0 (patch)
treea0c70c2e19c9484210c132af35a80342d937290f /src/leap/bitmask/backend
parent584a6d93ad1fe1ba46929108f002a16a8b70e95d (diff)
[feat] replace old log handler with new one
Replace logging.getLogger with custom get_logger. Remove some unneeded dependencies and reorder other.
Diffstat (limited to 'src/leap/bitmask/backend')
-rw-r--r--src/leap/bitmask/backend/backend.py7
-rw-r--r--src/leap/bitmask/backend/backend_proxy.py4
-rw-r--r--src/leap/bitmask/backend/components.py7
-rw-r--r--src/leap/bitmask/backend/leapbackend.py5
-rw-r--r--src/leap/bitmask/backend/settings.py4
-rw-r--r--src/leap/bitmask/backend/signaler.py4
-rw-r--r--src/leap/bitmask/backend/signaler_qt.py4
-rw-r--r--src/leap/bitmask/backend/utils.py4
8 files changed, 18 insertions, 21 deletions
diff --git a/src/leap/bitmask/backend/backend.py b/src/leap/bitmask/backend/backend.py
index fcbb19dc..4a98d146 100644
--- a/src/leap/bitmask/backend/backend.py
+++ b/src/leap/bitmask/backend/backend.py
@@ -17,7 +17,6 @@
# FIXME this is missing module documentation. It would be fine to say a couple
# of lines about the whole backend architecture.
-
import json
import os
import time
@@ -34,12 +33,12 @@ except ImportError:
pass
from leap.bitmask.backend.api import API, PING_REQUEST
+from leap.bitmask.backend.signaler import Signaler
from leap.bitmask.backend.utils import get_backend_certificates
from leap.bitmask.config import flags
-from leap.bitmask.backend.signaler import Signaler
+from leap.bitmask.logs.utils import get_logger
-import logging
-logger = logging.getLogger(__name__)
+logger = get_logger()
class TxZmqREPConnection(object):
diff --git a/src/leap/bitmask/backend/backend_proxy.py b/src/leap/bitmask/backend/backend_proxy.py
index 8d6930d6..30b7c5d1 100644
--- a/src/leap/bitmask/backend/backend_proxy.py
+++ b/src/leap/bitmask/backend/backend_proxy.py
@@ -34,9 +34,9 @@ from leap.bitmask.backend.settings import Settings
from leap.bitmask.backend.utils import generate_zmq_certificates_if_needed
from leap.bitmask.backend.utils import get_backend_certificates
from leap.bitmask.config import flags
+from leap.bitmask.logs.utils import get_logger
-import logging
-logger = logging.getLogger(__name__)
+logger = get_logger()
class ZmqREQConnection(threading.Thread):
diff --git a/src/leap/bitmask/backend/components.py b/src/leap/bitmask/backend/components.py
index d602156d..b833bf59 100644
--- a/src/leap/bitmask/backend/components.py
+++ b/src/leap/bitmask/backend/components.py
@@ -17,11 +17,9 @@
"""
Backend components
"""
-
# TODO [ ] Get rid of all this deferToThread mess, or at least contain
# all of it into its own threadpool.
-import logging
import os
import socket
import time
@@ -38,9 +36,10 @@ from leap.bitmask.backend.settings import Settings, GATEWAY_AUTOMATIC
from leap.bitmask.config.providerconfig import ProviderConfig
from leap.bitmask.crypto.srpauth import SRPAuth
from leap.bitmask.crypto.srpregister import SRPRegister
+from leap.bitmask.logs.utils import get_logger
from leap.bitmask.platform_init import IS_LINUX
-from leap.bitmask.provider.providerbootstrapper import ProviderBootstrapper
from leap.bitmask.provider.pinned import PinnedProviders
+from leap.bitmask.provider.providerbootstrapper import ProviderBootstrapper
from leap.bitmask.services import get_supported
from leap.bitmask.services.eip import eipconfig
from leap.bitmask.services.eip import get_openvpn_management
@@ -66,7 +65,7 @@ from leap.keymanager import openpgp
from leap.soledad.client.secrets import PassphraseTooShort
from leap.soledad.client.secrets import NoStorageSecret
-logger = logging.getLogger(__name__)
+logger = get_logger()
class ILEAPComponent(zope.interface.Interface):
diff --git a/src/leap/bitmask/backend/leapbackend.py b/src/leap/bitmask/backend/leapbackend.py
index 3b023563..cf45c4f8 100644
--- a/src/leap/bitmask/backend/leapbackend.py
+++ b/src/leap/bitmask/backend/leapbackend.py
@@ -17,16 +17,15 @@
"""
Backend for everything
"""
-import logging
-
import zope.interface
import zope.proxy
from leap.bitmask.backend import components
from leap.bitmask.backend.backend import Backend
from leap.bitmask.backend.settings import Settings
+from leap.bitmask.logs.utils import get_logger
-logger = logging.getLogger(__name__)
+logger = get_logger()
ERROR_KEY = "error"
PASSED_KEY = "passed"
diff --git a/src/leap/bitmask/backend/settings.py b/src/leap/bitmask/backend/settings.py
index ed70ca6b..dedfc13d 100644
--- a/src/leap/bitmask/backend/settings.py
+++ b/src/leap/bitmask/backend/settings.py
@@ -18,13 +18,13 @@
Backend settings
"""
import ConfigParser
-import logging
import os
+from leap.bitmask.logs.utils import get_logger
from leap.bitmask.util import get_path_prefix
from leap.common.check import leap_assert, leap_assert_type
-logger = logging.getLogger(__name__)
+logger = get_logger()
# We need this one available for the default decorator
GATEWAY_AUTOMATIC = "Automatic"
diff --git a/src/leap/bitmask/backend/signaler.py b/src/leap/bitmask/backend/signaler.py
index aec2f606..c5335eb8 100644
--- a/src/leap/bitmask/backend/signaler.py
+++ b/src/leap/bitmask/backend/signaler.py
@@ -27,9 +27,9 @@ import zmq
from leap.bitmask.backend.api import SIGNALS
from leap.bitmask.backend.utils import get_frontend_certificates
from leap.bitmask.config import flags
+from leap.bitmask.logs.utils import get_logger
-import logging
-logger = logging.getLogger(__name__)
+logger = get_logger()
class Signaler(object):
diff --git a/src/leap/bitmask/backend/signaler_qt.py b/src/leap/bitmask/backend/signaler_qt.py
index b7f48d21..e3244934 100644
--- a/src/leap/bitmask/backend/signaler_qt.py
+++ b/src/leap/bitmask/backend/signaler_qt.py
@@ -33,9 +33,9 @@ except ImportError:
from leap.bitmask.backend.api import SIGNALS
from leap.bitmask.backend.utils import get_frontend_certificates
from leap.bitmask.config import flags
+from leap.bitmask.logs.utils import get_logger
-import logging
-logger = logging.getLogger(__name__)
+logger = get_logger()
class SignalerQt(QtCore.QObject):
diff --git a/src/leap/bitmask/backend/utils.py b/src/leap/bitmask/backend/utils.py
index b2674330..3b5effc5 100644
--- a/src/leap/bitmask/backend/utils.py
+++ b/src/leap/bitmask/backend/utils.py
@@ -17,7 +17,6 @@
"""
Backend utilities to handle ZMQ certificates.
"""
-import logging
import os
import shutil
import stat
@@ -30,11 +29,12 @@ except ImportError:
pass
from leap.bitmask.config import flags
+from leap.bitmask.logs.utils import get_logger
from leap.bitmask.util import get_path_prefix
from leap.common.files import mkdir_p
from leap.common.check import leap_assert
-logger = logging.getLogger(__name__)
+logger = get_logger()
KEYS_DIR = os.path.join(get_path_prefix(), 'leap', 'zmq_certificates')