From 460c619796f056b7a407a0ee6f07e771ed0621c1 Mon Sep 17 00:00:00 2001 From: SeokYeon Hwang Date: Fri, 12 Jun 2015 18:05:10 +0900 Subject: [PATCH] manager: rich logging Change-Id: Iab8c9d61964af70ab7d86c5bd89ed707a0da49eb Signed-off-by: SeokYeon Hwang --- src/org/tizen/emulator/manager/job/CheckSDCard.java | 6 ++++-- src/org/tizen/emulator/manager/job/Overseer.java | 4 ++-- src/org/tizen/emulator/manager/vms/helper/HelperClass.java | 3 +++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/org/tizen/emulator/manager/job/CheckSDCard.java b/src/org/tizen/emulator/manager/job/CheckSDCard.java index e70eb17..c3a4263 100644 --- a/src/org/tizen/emulator/manager/job/CheckSDCard.java +++ b/src/org/tizen/emulator/manager/job/CheckSDCard.java @@ -67,10 +67,12 @@ public class CheckSDCard implements Job { // copy sdcard images if only new sdcard images are provided. if (sourceAttr.lastModifiedTime().compareTo(targetAttr.lastModifiedTime()) <= 0) { - // FIXME: if newer images are exist, - // we should warn to user before replace legacy images. continue; } + + // FIXME: if newer images are exist, + // we should warn to user before replace legacy images. + EMLogger.getLogger().log(Level.INFO, "Newer SDCARD image is provided: " + source.getFileName()); } Files.copy(source, target, StandardCopyOption.COPY_ATTRIBUTES, StandardCopyOption.REPLACE_EXISTING); diff --git a/src/org/tizen/emulator/manager/job/Overseer.java b/src/org/tizen/emulator/manager/job/Overseer.java index 3134c86..147d1ea 100644 --- a/src/org/tizen/emulator/manager/job/Overseer.java +++ b/src/org/tizen/emulator/manager/job/Overseer.java @@ -71,7 +71,6 @@ public class Overseer { } public void startWork() throws InterruptedException { - EMLogger.getLogger().log(Level.INFO, "Overseer [" + name + "] is starting..."); if (overseerThread != null) { // already started assert false : "Overseer [" + name + "] already started !!!"; // for debugging... @@ -83,7 +82,9 @@ public class Overseer { @Override public void run() { try { + EMLogger.getLogger().log(Level.INFO, "Overseer [" + name + "] is starting..."); Overseer.this.startWorkInternal(); + EMLogger.getLogger().log(Level.INFO, "Overseer [" + name + "] is done..."); } catch (InterruptedException e) { e.printStackTrace(); } @@ -92,7 +93,6 @@ public class Overseer { overseerThread.start(); - EMLogger.getLogger().log(Level.INFO, "Overseer [" + name + "] is done..."); } public void join() throws InterruptedException { diff --git a/src/org/tizen/emulator/manager/vms/helper/HelperClass.java b/src/org/tizen/emulator/manager/vms/helper/HelperClass.java index 6345493..27e2953 100644 --- a/src/org/tizen/emulator/manager/vms/helper/HelperClass.java +++ b/src/org/tizen/emulator/manager/vms/helper/HelperClass.java @@ -43,6 +43,7 @@ import java.net.SocketException; import java.util.Arrays; import java.util.Enumeration; import java.util.List; +import java.util.logging.Level; import org.tizen.emulator.manager.EmulatorManager; import org.tizen.emulator.manager.logging.EMLogger; @@ -245,6 +246,8 @@ public class HelperClass { pb.directory(directory); } + EMLogger.getLogger().log(Level.INFO, "Try to run external process: " + cmd.get(0)); + try { process = pb.start(); List stdOut = ProcessOutputReader.readStdOut(process, cmd.toString()); -- 2.7.4