diff options
author | Kali Kaneko <kali@leap.se> | 2013-09-03 15:53:04 +0200 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2013-09-03 15:55:17 +0200 |
commit | 2c2f1eb7714bf98059b6966e08d01897c5626bd4 (patch) | |
tree | b0acf685b74a784565799851b0b18dd86d13faf2 /src | |
parent | 21b7235a4368c6681f2788893dd5073c9fffd37d (diff) |
change verbosity level in logging
Diffstat (limited to 'src')
-rw-r--r-- | src/leap/common/events/client.py | 11 | ||||
-rw-r--r-- | src/leap/common/events/server.py | 11 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/leap/common/events/client.py b/src/leap/common/events/client.py index ff1f52a..83f18e0 100644 --- a/src/leap/common/events/client.py +++ b/src/leap/common/events/client.py @@ -133,12 +133,13 @@ def register(signal, callback, uid=None, replace=False, reqcbk=None, request.mac = "" service = RpcService(proto.EventsServerService_Stub, server.SERVER_PORT, 'localhost') - logger.info( + logger.debug( "Sending registration request to server on port %s: %s", server.SERVER_PORT, str(request)[:40]) return service.register(request, callback=reqcbk, timeout=timeout) + def unregister(signal, uid=None, reqcbk=None, timeout=1000): """ Unregister a callback. @@ -226,7 +227,7 @@ def signal(signal, content="", mac_method="", mac="", reqcbk=None, request.mac = mac service = RpcService(proto.EventsServerService_Stub, server.SERVER_PORT, 'localhost') - logger.info("Sending signal to server: %s", str(request)[:40]) + logger.debug("Sending signal to server: %s", str(request)[:40]) return service.signal(request, callback=reqcbk, timeout=timeout) @@ -251,7 +252,7 @@ def ping(port, reqcbk=None, timeout=1000): proto.EventsClientService_Stub, port, 'localhost') - logger.info("Pinging a client in port %d..." % port) + logger.debug("Pinging a client in port %d..." % port) return service.ping(request, callback=reqcbk, timeout=timeout) @@ -277,7 +278,7 @@ class EventsClientService(proto.EventsClientService): :param done: callback to be called when done :type done: protobuf.socketrpc.server.Callback """ - logger.info('Received signal from server: %s...' % str(request)[:40]) + logger.debug('Received signal from server: %s...' % str(request)[:40]) # run registered callbacks # TODO: verify authentication using mac in incoming message @@ -303,7 +304,7 @@ class EventsClientService(proto.EventsClientService): :param done: callback to be called when done :type done: protobuf.socketrpc.server.Callback """ - logger.info("Received ping request, sending response.") + logger.debug("Received ping request, sending response.") response = proto.EventResponse() response.status = proto.EventResponse.OK done.run(response) diff --git a/src/leap/common/events/server.py b/src/leap/common/events/server.py index 861cb4f..dc55551 100644 --- a/src/leap/common/events/server.py +++ b/src/leap/common/events/server.py @@ -85,6 +85,7 @@ def ensure_server(port=SERVER_PORT): logger.info('Launching server on port %d.', port) return EventsServerDaemon.ensure(port) + def process_ping(port, request, response): """ Response callback for the ping event. @@ -100,7 +101,7 @@ def process_ping(port, request, response): logger.info('A server is already running on port %d.', port) return # port is taken, and not by an events server - logger.info('Port %d is taken by something not an events server.', port) + logger.warning('Port %d is taken by something not an events server.', port) raise PortAlreadyTaken(port) @@ -125,7 +126,7 @@ def ping(port=SERVER_PORT, reqcbk=None, timeout=1000): proto.EventsServerService_Stub, port, 'localhost') - logger.info("Pinging server in port %d..." % port) + logger.debug("Pinging server in port %d..." % port) return service.ping(request, callback=reqcbk, timeout=timeout) @@ -196,14 +197,14 @@ class EventsServerService(proto.EventsServerService): :param done: callback to be called when done :type done: protobuf.socketrpc.server.Callback """ - logger.info('Received signal from client: %s...', str(request)[:40]) + logger.debug('Received signal from client: %s...', str(request)[:40]) # send signal to all registered clients # TODO: verify signal auth if request.event in registered_clients: for port in registered_clients[request.event]: def callback(req, resp): - logger.info("Signal received by " + str(port)) + logger.debug("Signal received by " + str(port)) service = RpcService(proto.EventsClientService_Stub, port, 'localhost') @@ -224,7 +225,7 @@ class EventsServerService(proto.EventsServerService): :param done: callback to be called when done :type done: protobuf.socketrpc.server.Callback """ - logger.info("Received ping request, sending response.") + logger.debug("Received ping request, sending response.") response = proto.EventResponse() response.status = proto.EventResponse.OK done.run(response) |