Move the utility functions to a class so logs can be recorded
This allows to record the logs as they are printed which allows the
scheduler/runner to access these logs and do something with them, such
as publishing them via fedora-messaging.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>