[Title] modify skin log file path
authorSon Hyunjun <hj79.son@samsung.com>
Sat, 17 Mar 2012 18:28:51 +0000 (03:28 +0900)
committerSon Hyunjun <hj79.son@samsung.com>
Sat, 17 Mar 2012 18:28:51 +0000 (03:28 +0900)
[Type] Bugfix
[Module]
[Priority] Minor
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]

Change-Id: I738f1040bdc485ccd302ecafb4648bf1a4c44096

tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java
tizen/src/skin/client/src/org/tizen/emulator/skin/log/SkinLogger.java

index 31f7807..128bf3b 100644 (file)
@@ -117,13 +117,15 @@ public class EmulatorSkinMain {
        private static void initLog( String[] args ) {
 
                String logLevel = "";
+               String vmPath = "";
                for ( int i = 0; i < args.length; i++ ) {
                        String[] split = args[i].split( "=" );
                        if ( split[0].trim().equalsIgnoreCase( ArgsConstants.LOG_LEVEL ) ) {
                                if ( !StringUtil.isEmpty( split[1].trim() ) ) {
-                                       logLevel = split[1];
-                                       break;
+                                       logLevel = split[1].trim();
                                }
+                       }else if ( split[0].trim().equalsIgnoreCase( ArgsConstants.VM_PATH ) ) {
+                               vmPath = split[1].trim();
                        }
                }
 
@@ -139,7 +141,7 @@ public class EmulatorSkinMain {
                        }
                }
 
-               SkinLogger.init( skinLogLevel );
+               SkinLogger.init( skinLogLevel, vmPath );
                logger = SkinLogger.getSkinLogger( EmulatorSkinMain.class ).getLogger();
 
        }
index 777bab3..8e345c9 100644 (file)
@@ -29,6 +29,7 @@
 
 package org.tizen.emulator.skin.log;
 
+import java.io.File;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.util.HashMap;
@@ -38,12 +39,16 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.logging.SimpleFormatter;
 
+import org.tizen.emulator.skin.util.StringUtil;
+
 /**
  * 
  *
  */
 public class SkinLogger {
        
+       public static final String LOG_FOLDER = "logs";
+       
        public enum SkinLogLevel {
                
                ERROR(Level.SEVERE, "error"),
@@ -81,14 +86,22 @@ public class SkinLogger {
                return this.logger;
        }
        
-       public static void init( SkinLogLevel logLevel ) {
+       public static void init( SkinLogLevel logLevel, String filePath ) {
                
                if( !isInit ) {
                        
                        isInit = true;
-
+                       
+                       String path = "";
+                       
+                       if( !StringUtil.isEmpty( filePath ) ) {
+                               path = filePath;
+                       }
+                       
                        try {
-                               fileHandler = new FileHandler( FILE_NAME, false );
+                               path = path + File.separator + LOG_FOLDER + File.separator + FILE_NAME;
+                               System.out.println( "[SkinLog]log file path:" + path );
+                               fileHandler = new FileHandler( path, false );
                        } catch ( SecurityException e1 ) {
                                e1.printStackTrace();
                        } catch ( IOException e1 ) {