Search code examples
gwtlibgdx

HTML version of LibGDX game doesn't show any logging


I am having trouble getting a html version of my programme to appear. I am using LibGDX 1.3.1 and running in Java it works fine.

I uploaded the game here:

http://www.darkflame.co.uk/MeshExplorer/index.html

The libgdx loading bar appears and finishes - and in Chromes network tag I can see assets loading. However, nothing appears other then the rectangle of the expected game size.

Most confusingly for me though, I dont see any crashes or logs from my code. That is, there is nothing after "SoundManager 2 loaded (OK) "

Given that the first lines of my main core class are:

   game=this;
   font = new BitmapFont();
   batch = new SpriteBatch();

   Gdx.app.log(logstag, "loading..");

I expected at least to see "loading.."

I even added some gwt logs to html launcher

 public class HtmlLauncher extends GwtApplication {
   static Logger Log = Logger.getLogger("HtmlLauncher");

    @Override
    public GwtApplicationConfiguration getConfig () {
       Log.info("GwtApplicationConfiguration");
      System.out.print("GwtApplicationConfiguration");
            return new GwtApplicationConfiguration(640, 480);
    }

    @Override
    public ApplicationListener getApplicationListener () {
          Log.info("test, returning class ME() ");
          System.out.print("test, returning class ME() ");
            return new ME();
    }

}

again, nothing.

I am at a lose how to disorganize this problem further. It just seems like libgdx isn't even attempting to run my code.


Solution

  • The default logging level in the html target is LOG_ERROR. You would not see any Gdx.app.log messages unless you set the logging level to LOG_INFO.

    Calling Gdx.app.setLogLevel(LOG_INFO) in your getConfig or getApplicationListener methods should do the trick.