diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-11-08 18:17:17 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-11-09 12:24:24 +0000 |
commit | 0e198a7311fe341c5bc20a697e90da2928c44262 (patch) | |
tree | 9d864cb840bb6295b28d93159c17384e2d5505e7 /meta/lib/oeqa/utils/qemurunner.py | |
parent | 7608f33f0f0c6c1c61c80a77e12270d06b236d84 (diff) | |
download | poky-0e198a7311fe341c5bc20a697e90da2928c44262.tar.gz |
oeqa: Clean up logger handling
The logger handling in oeqa was confused at best. This patch:
a) Passes in a logger through various qemu runner pieces
b) Uses that logger consistently in the code
c) Creates a logger for QemuRunner outside the bitbake namespace
meaning we don't conflict with the tinfoil logging changes
The result of this is more consistency. For runtime tests in testimage,
the logs always contain the debug info, nothing is shwon on the console.
For the oe-selftests, logs are intercepted and only shown if the test
fails.
(From OE-Core rev: 4ff678137a55b93c9ba2cbffda34335ba859f704)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/qemurunner.py')
-rw-r--r-- | meta/lib/oeqa/utils/qemurunner.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index 32148871ff..82335d8456 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py | |||
@@ -28,7 +28,7 @@ re_control_char = re.compile('[%s]' % re.escape("".join(control_chars))) | |||
28 | 28 | ||
29 | class QemuRunner: | 29 | class QemuRunner: |
30 | 30 | ||
31 | def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, boottime, dump_dir, dump_host_cmds, use_kvm): | 31 | def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, boottime, dump_dir, dump_host_cmds, use_kvm, logger): |
32 | 32 | ||
33 | # Popen object for runqemu | 33 | # Popen object for runqemu |
34 | self.runqemu = None | 34 | self.runqemu = None |
@@ -57,9 +57,7 @@ class QemuRunner: | |||
57 | self.qemu_pidfile = 'pidfile_'+str(os.getpid()) | 57 | self.qemu_pidfile = 'pidfile_'+str(os.getpid()) |
58 | self.host_dumper = HostDumper(dump_host_cmds, dump_dir) | 58 | self.host_dumper = HostDumper(dump_host_cmds, dump_dir) |
59 | 59 | ||
60 | self.logger = logging.getLogger("BitBake.QemuRunner") | 60 | self.logger = logger |
61 | self.handler = logging.StreamHandler(sys.stdout) | ||
62 | self.logger.addHandler(self.handler) | ||
63 | 61 | ||
64 | def create_socket(self): | 62 | def create_socket(self): |
65 | try: | 63 | try: |
@@ -371,7 +369,6 @@ class QemuRunner: | |||
371 | self.ip = None | 369 | self.ip = None |
372 | if os.path.exists(self.qemu_pidfile): | 370 | if os.path.exists(self.qemu_pidfile): |
373 | os.remove(self.qemu_pidfile) | 371 | os.remove(self.qemu_pidfile) |
374 | self.logger.removeHandler(self.handler) | ||
375 | 372 | ||
376 | def stop_qemu_system(self): | 373 | def stop_qemu_system(self): |
377 | if self.qemupid: | 374 | if self.qemupid: |