Include phase name in log for some phases
Phases createiso, liveimages, image_build, ostree_installer and osbs are done in parallel, logs from these phases are mixed and and it's not obvious which log message belongs to which phase. This change adds phase name in log message for these phases. The new mixin 'PhaseLoggerMixin' is added to extend a Pungi phase with a logging logger which copy handlers from compose's logger but with formatter changed. Fixes: #58 Signed-off-by: Qixiang Wan <qwan@redhat.com>
This commit is contained in:
parent
9e52c68c82
commit
80fa723b1d
20 changed files with 134 additions and 91 deletions
|
|
@ -516,7 +516,7 @@ class TestLiveMediaThread(PungiTestCase):
|
|||
with mock.patch('time.sleep'):
|
||||
t.process((compose, compose.variants['Server'], config), 1)
|
||||
|
||||
compose.log_info.assert_has_calls([
|
||||
pool._logger.info.assert_has_calls([
|
||||
mock.call('[FAIL] Live media (variant Server, arch *, subvariant KDE) failed, but going on anyway.'),
|
||||
mock.call('Live media task failed: 1234. See %s for more details.'
|
||||
% (os.path.join(self.topdir, 'logs/amd64-x86_64/livemedia-Server-KDE.amd64-x86_64.log')))
|
||||
|
|
@ -559,7 +559,7 @@ class TestLiveMediaThread(PungiTestCase):
|
|||
with mock.patch('time.sleep'):
|
||||
t.process((compose, compose.variants['Server'], config), 1)
|
||||
|
||||
compose.log_info.assert_has_calls([
|
||||
pool._logger.info.assert_has_calls([
|
||||
mock.call('[FAIL] Live media (variant Server, arch *, subvariant KDE) failed, but going on anyway.'),
|
||||
mock.call('BOOM')
|
||||
])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue