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();
}
}
}
}
- SkinLogger.init( skinLogLevel );
+ SkinLogger.init( skinLogLevel, vmPath );
logger = SkinLogger.getSkinLogger( EmulatorSkinMain.class ).getLogger();
}
package org.tizen.emulator.skin.log;
+import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
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"),
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 ) {