summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/hashserv/server.py
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2023-11-03 08:26:23 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-11-09 17:33:02 +0000
commit4cdb0f00f9c687337bd08b97022349f4dddadcc0 (patch)
tree6a5195e72017ae93572be7e32b920d682bf98083 /bitbake/lib/hashserv/server.py
parent8ae00cf20d510995263cfc948e73b0556ffdbf32 (diff)
downloadpoky-4cdb0f00f9c687337bd08b97022349f4dddadcc0.tar.gz
bitbake: 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 (Bitbake rev: f4d64ce73c2449c008ff5d9b32376a2893ef7195) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/hashserv/server.py')
-rw-r--r--bitbake/lib/hashserv/server.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/bitbake/lib/hashserv/server.py b/bitbake/lib/hashserv/server.py
index 13b754805b..e6a3f40577 100644
--- a/bitbake/lib/hashserv/server.py
+++ b/bitbake/lib/hashserv/server.py
@@ -207,7 +207,7 @@ class ServerClient(bb.asyncrpc.AsyncServerConnection):
207 async def dispatch_message(self, msg): 207 async def dispatch_message(self, msg):
208 for k in self.handlers.keys(): 208 for k in self.handlers.keys():
209 if k in msg: 209 if k in msg:
210 logger.debug('Handling %s' % k) 210 self.logger.debug('Handling %s' % k)
211 if 'stream' in k: 211 if 'stream' in k:
212 return await self.handlers[k](msg[k]) 212 return await self.handlers[k](msg[k])
213 else: 213 else:
@@ -351,7 +351,7 @@ class ServerClient(bb.asyncrpc.AsyncServerConnection):
351 break 351 break
352 352
353 (method, taskhash) = l.split() 353 (method, taskhash) = l.split()
354 #logger.debug('Looking up %s %s' % (method, taskhash)) 354 #self.logger.debug('Looking up %s %s' % (method, taskhash))
355 cursor = self.db.cursor() 355 cursor = self.db.cursor()
356 try: 356 try:
357 row = self.query_equivalent(cursor, method, taskhash) 357 row = self.query_equivalent(cursor, method, taskhash)
@@ -360,7 +360,7 @@ class ServerClient(bb.asyncrpc.AsyncServerConnection):
360 360
361 if row is not None: 361 if row is not None:
362 msg = row['unihash'] 362 msg = row['unihash']
363 #logger.debug('Found equivalent task %s -> %s', (row['taskhash'], row['unihash'])) 363 #self.logger.debug('Found equivalent task %s -> %s', (row['taskhash'], row['unihash']))
364 elif self.upstream_client is not None: 364 elif self.upstream_client is not None:
365 upstream = await self.upstream_client.get_unihash(method, taskhash) 365 upstream = await self.upstream_client.get_unihash(method, taskhash)
366 if upstream: 366 if upstream:
@@ -480,8 +480,8 @@ class ServerClient(bb.asyncrpc.AsyncServerConnection):
480 row = self.query_equivalent(cursor, data['method'], data['taskhash']) 480 row = self.query_equivalent(cursor, data['method'], data['taskhash'])
481 481
482 if row['unihash'] == data['unihash']: 482 if row['unihash'] == data['unihash']:
483 logger.info('Adding taskhash equivalence for %s with unihash %s', 483 self.logger.info('Adding taskhash equivalence for %s with unihash %s',
484 data['taskhash'], row['unihash']) 484 data['taskhash'], row['unihash'])
485 485
486 d = {k: row[k] for k in ('taskhash', 'method', 'unihash')} 486 d = {k: row[k] for k in ('taskhash', 'method', 'unihash')}
487 487