diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2023-11-03 08:26:23 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-09 17:21:15 +0000 |
commit | f4d64ce73c2449c008ff5d9b32376a2893ef7195 (patch) | |
tree | e16ae5ad28513f8e8a192a4670afe56b45a85b73 /lib/hashserv | |
parent | c1fbc3f68b94905d19ffcf4a6da5b27f0bf14599 (diff) | |
download | bitbake-f4d64ce73c2449c008ff5d9b32376a2893ef7195.tar.gz |
asyncrpc: Prefix log messages with client info
Adds a logging adaptor to the asyncrpc clients that prefixes log
messages with the client remote address to aid in debugging
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/hashserv')
-rw-r--r-- | lib/hashserv/server.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/hashserv/server.py b/lib/hashserv/server.py index 13b754805..e6a3f4057 100644 --- a/lib/hashserv/server.py +++ b/lib/hashserv/server.py @@ -207,7 +207,7 @@ class ServerClient(bb.asyncrpc.AsyncServerConnection): async def dispatch_message(self, msg): for k in self.handlers.keys(): if k in msg: - logger.debug('Handling %s' % k) + self.logger.debug('Handling %s' % k) if 'stream' in k: return await self.handlers[k](msg[k]) else: @@ -351,7 +351,7 @@ class ServerClient(bb.asyncrpc.AsyncServerConnection): break (method, taskhash) = l.split() - #logger.debug('Looking up %s %s' % (method, taskhash)) + #self.logger.debug('Looking up %s %s' % (method, taskhash)) cursor = self.db.cursor() try: row = self.query_equivalent(cursor, method, taskhash) @@ -360,7 +360,7 @@ class ServerClient(bb.asyncrpc.AsyncServerConnection): if row is not None: msg = row['unihash'] - #logger.debug('Found equivalent task %s -> %s', (row['taskhash'], row['unihash'])) + #self.logger.debug('Found equivalent task %s -> %s', (row['taskhash'], row['unihash'])) elif self.upstream_client is not None: upstream = await self.upstream_client.get_unihash(method, taskhash) if upstream: @@ -480,8 +480,8 @@ class ServerClient(bb.asyncrpc.AsyncServerConnection): row = self.query_equivalent(cursor, data['method'], data['taskhash']) if row['unihash'] == data['unihash']: - logger.info('Adding taskhash equivalence for %s with unihash %s', - data['taskhash'], row['unihash']) + self.logger.info('Adding taskhash equivalence for %s with unihash %s', + data['taskhash'], row['unihash']) d = {k: row[k] for k in ('taskhash', 'method', 'unihash')} |