From: minkee.lee Date: Thu, 21 May 2015 04:55:45 +0000 (+0900) Subject: Launcher: Fixed emulator log redirection for Windows OS. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c6281988d2eff539f79631e43072fc0af283438;p=sdk%2Femulator%2Femulator-manager.git Launcher: Fixed emulator log redirection for Windows OS. - Added environment variable "SDL_STDIO_REDIRECT=0" when launch. - Changed some launch log. Change-Id: Id4e43338e543c2e88bbe4035f557f05f28e78fa3 Signed-off-by: minkee.lee --- diff --git a/src/org/tizen/emulator/manager/vms/VMLauncher.java b/src/org/tizen/emulator/manager/vms/VMLauncher.java index 0fd996b..fb22607 100644 --- a/src/org/tizen/emulator/manager/vms/VMLauncher.java +++ b/src/org/tizen/emulator/manager/vms/VMLauncher.java @@ -60,10 +60,6 @@ public class VMLauncher { List cmd = getCommand(property); - for (String str : LaunchConfig.readLaunchConfig(property.getName())) { - System.out.println(str); - } - CheckingRunningEmulator.addEmulator(property); MonitoringEmulator monitor = new MonitoringEmulator(property); Process process = launch(property.getName(), property.getPropertyValue().version, @@ -117,6 +113,7 @@ public class VMLauncher { } List cmd = new ArrayList(); + String emulatorCmd = binaryPath + " --conf " + configPath; if (EmulatorManager.isWin()) { cmd.add("cmd"); cmd.add("/c"); @@ -124,8 +121,11 @@ public class VMLauncher { cmd.add("/bin/sh"); cmd.add("-c"); } - cmd.add(binaryPath + " -c " + configPath + " > " - + VMLogUtil.getEmulatorLogPath(property.getName()) + " 2>&1"); + System.out.println("Launch command : " + emulatorCmd); + EMLogger.getLogger().log(Level.INFO, "Starting Emulator Command : "); + EMLogger.getLogger().log(Level.INFO, emulatorCmd); + // Add log redirection to command. + cmd.add(emulatorCmd + " > " + VMLogUtil.getEmulatorLogPath(property.getName()) + " 2>&1"); return cmd; @@ -173,9 +173,8 @@ public class VMLauncher { // Make backup log. // LogUtil.makeVMBackupLog(vmName); - EMLogger.getLogger().info(pb.command().toString()); + Map env = pb.environment(); if (EmulatorManager.isLinux()) { - Map env = pb.environment(); String value = env.get("LD_LIBRARY_PATH"); env.put("LD_LIBRARY_PATH", ((value == null) ? "" : value + ":") @@ -184,6 +183,11 @@ public class VMLauncher { + File.separator + "lib:"); EMLogger.getLogger().log(Level.INFO, "LD_LIBRARY_PATH=" + env.get("LD_LIBRARY_PATH")); + + } else if (EmulatorManager.isWin()) { + env.put("SDL_STDIO_REDIRECT","0"); + EMLogger.getLogger().log(Level.INFO, + "ENV : SDL_STDIO_REDIRECT=" + env.get("SDL_STDIO_REDIRECT")); } if (binPath == null || binPath.isEmpty()) { @@ -193,13 +197,12 @@ public class VMLauncher { } // Log launch config. - String temp = LaunchConfig.getLaunchConfigPath(vmName) - + StringResources.NEW_LINE; + String launchConfig = StringResources.NEW_LINE; for (String str : LaunchConfig.readLaunchConfig(vmName)) { - temp += (str + StringResources.NEW_LINE); + launchConfig += (str + StringResources.NEW_LINE); } - EMLogger.getLogger().log(Level.INFO, "Starting Emulator Command : "); - EMLogger.getLogger().log(Level.INFO, temp); + EMLogger.getLogger().log(Level.INFO, "Launch config file : " + + LaunchConfig.getLaunchConfigPath(vmName) + launchConfig); Process process = null; try {