Android: fixed logging

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7902 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
kim..ng 14 years ago
parent c172b2e455
commit 0b7f96726f
  1. 21
      engine/src/android/com/jme3/app/AndroidHarness.java
  2. 2
      engine/src/android/com/jme3/asset/plugins/AndroidLocator.java

@ -1,7 +1,9 @@
package com.jme3.app;
import java.util.logging.Handler;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
import com.jme3.util.JmeFormatter;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
@ -104,6 +106,23 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
{
super.onCreate(savedInstanceState);
Logger log = logger;
boolean bIsLogFormatSet = false;
do
{
if (log.getHandlers().length == 0)
{
log = logger.getParent();
if (log != null)
for (Handler h : log.getHandlers())
{
//h.setFormatter(new SimpleFormatter());
h.setFormatter(new JmeFormatter());
bIsLogFormatSet = true;
}
}
} while (log != null && !bIsLogFormatSet);
JmeSystem.setResources(getResources());
JmeSystem.setActivity(this);

@ -67,7 +67,7 @@ public class AndroidLocator implements AssetLocator {
}
catch (IOException ex)
{
logger.log(Level.WARNING, "Failed to locate {0} ", sAssetPath);
//logger.log(Level.WARNING, "Failed to locate {0} ", sAssetPath);
}
return null;
}

Loading…
Cancel
Save