summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/core/service.py
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2016-10-05 12:28:14 -0400
committerKali Kaneko (leap communications) <kali@leap.se>2016-10-07 10:22:36 -0400
commit99b53c1714d302d7f0884e03b5c102081c483504 (patch)
tree82ac74e776a330338bf94563273aa4d33f578877 /src/leap/bitmask/core/service.py
parent4a471fb8b434d3df07c5de42fc41590b5d9fc5f5 (diff)
[refactor] use new logger infrastructure
Diffstat (limited to 'src/leap/bitmask/core/service.py')
-rw-r--r--src/leap/bitmask/core/service.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/leap/bitmask/core/service.py b/src/leap/bitmask/core/service.py
index 1a544ac..5718178 100644
--- a/src/leap/bitmask/core/service.py
+++ b/src/leap/bitmask/core/service.py
@@ -21,7 +21,7 @@ import json
import resource
from twisted.internet import reactor
-from twisted.python import log
+from twisted.logger import Logger
from leap.bitmask import __version__
from leap.bitmask.core import configurable
@@ -31,6 +31,8 @@ from leap.bitmask.core import flags
from leap.common.events import server as event_server
# from leap.vpn import EIPService
+logger = Logger()
+
backend = flags.BACKEND
@@ -92,13 +94,13 @@ class BitmaskBackend(configurable.ConfigurableService):
bf.register_hook('on_bonafide_logout', listener='mail')
def _start_child_service(self, name):
- log.msg('starting backend child service: %s' % name)
+ logger.debug('starting backend child service: %s' % name)
service = self.getServiceNamed(name)
if service:
service.startService()
def _stop_child_service(self, name):
- log.msg('stopping backend child service: %s' % name)
+ logger.debug('stopping backend child service: %s' % name)
service = self.getServiceNamed(name)
if service:
service.stopService()
@@ -159,7 +161,7 @@ class BitmaskBackend(configurable.ConfigurableService):
try:
service = self.getServiceNamed(label)
except KeyError:
- log.msg("initializing service: %s" % label)
+ logger.debug("initializing service: %s" % label)
service = klass(*args, **kw)
service.setName(label)
service.setServiceParent(self)
@@ -238,7 +240,7 @@ class BackendCommands(object):
return {'version_core': __version__}
def do_stats(self):
- log.msg('BitmaskCore Service STATS')
+ logger.debug('BitmaskCore Service STATS')
mem = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
return {'mem_usage': '%s MB' % (mem / 1024)}