diff options
Diffstat (limited to 'core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/viewer/ViewerUtils.java')
-rw-r--r-- | core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/viewer/ViewerUtils.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/viewer/ViewerUtils.java b/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/viewer/ViewerUtils.java index 1ed5947a..40c45671 100644 --- a/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/viewer/ViewerUtils.java +++ b/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/viewer/ViewerUtils.java @@ -9,6 +9,7 @@ import org.apache.commons.exec.PumpStreamHandler; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.io.output.ByteArrayOutputStream; +import org.apache.log4j.Logger; /** * Utils for viewing displays of virtual machines. @@ -19,6 +20,11 @@ import org.apache.commons.io.output.ByteArrayOutputStream; public class ViewerUtils { /** + * Reference to the global logger for this class. + */ + private static final Logger LOGGER = Logger.getLogger( ViewerUtils.class ); + + /** * Synchronously executes a viewer program specified by a command line call. * <p> * The command line call of the viewer program consists of the program name and an optional list @@ -57,9 +63,13 @@ public class ViewerUtils throw new ViewerException( "Failed to execute '" + viewerProgram + "': " + e.getLocalizedMessage() ); } + // retrieve the content from the viewer's standard output final String viewerOuput = viewerOutputStream.toString( StandardCharsets.UTF_8 ); IOUtils.closeQuietly( viewerOutputStream ); + // log content from the viewer's standard output + ViewerUtils.LOGGER.debug( viewerOuput ); + return viewerOuput; } } |