diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2023-11-10 08:50:09 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-14 23:39:53 +0000 |
commit | f5a4dc0c17693bd70cd3571efe39df27a4bd33f9 (patch) | |
tree | 88a7eeabb23e29c1955c0521f7a0f7210a134397 /bitbake/lib/bb/asyncrpc | |
parent | ca74df3a6900f7836fe617a0baec65c4efe003aa (diff) | |
download | poky-f5a4dc0c17693bd70cd3571efe39df27a4bd33f9.tar.gz |
bitbake: asyncrpc: Add option to set log level when running as a process
When running an asyncrpc server as a subprocess, it is often desired to
run it with a lower logging level since the normal logging of clients
connecting and disconnecting is not desired.
As such, add an option to set the logging level of the server when
running as a subprocess and set the level to WARNING when starting a
local hashserver or PRserver
(Bitbake rev: 61dac7b99ad6d2a858f85d8ed1b5524d558be6c8)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/asyncrpc')
-rw-r--r-- | bitbake/lib/bb/asyncrpc/serv.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bitbake/lib/bb/asyncrpc/serv.py b/bitbake/lib/bb/asyncrpc/serv.py index 5fed1730df..f0be9a6cdb 100644 --- a/bitbake/lib/bb/asyncrpc/serv.py +++ b/bitbake/lib/bb/asyncrpc/serv.py | |||
@@ -322,7 +322,7 @@ class AsyncServer(object): | |||
322 | self.loop = asyncio.new_event_loop() | 322 | self.loop = asyncio.new_event_loop() |
323 | asyncio.set_event_loop(self.loop) | 323 | asyncio.set_event_loop(self.loop) |
324 | 324 | ||
325 | def serve_as_process(self, *, prefunc=None, args=()): | 325 | def serve_as_process(self, *, prefunc=None, args=(), log_level=None): |
326 | """ | 326 | """ |
327 | Serve requests in a child process | 327 | Serve requests in a child process |
328 | """ | 328 | """ |
@@ -351,6 +351,9 @@ class AsyncServer(object): | |||
351 | if prefunc is not None: | 351 | if prefunc is not None: |
352 | prefunc(self, *args) | 352 | prefunc(self, *args) |
353 | 353 | ||
354 | if log_level is not None: | ||
355 | self.logger.setLevel(log_level) | ||
356 | |||
354 | self._serve_forever(tasks) | 357 | self._serve_forever(tasks) |
355 | 358 | ||
356 | if sys.version_info >= (3, 6): | 359 | if sys.version_info >= (3, 6): |