com.badlogic.gdx.utils.Logger Java Examples

The following examples show how to use com.badlogic.gdx.utils.Logger. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JamepadController.java    From gdx-controllerutils with Apache License 2.0 6 votes vote down vote up
private void updateButtonsState() {
    for (ControllerButton button : ControllerButton.values()) {
        int id = button.ordinal();

        boolean pressed = getButton(id);
        if (pressed != buttonState.get(id)) {
            if (pressed) {
                compositeControllerListener.buttonDown(this, id);
            } else {
                compositeControllerListener.buttonUp(this, id);
            }

            if (logger.getLevel() == Logger.DEBUG) {
                logger.debug("Button [" + id + " - " + toButton(id) + "] is " + (pressed ? "pressed" : "released"));
            }
        }
        buttonState.put(id, pressed);
    }
}
 
Example #2
Source File: AMScreen.java    From cocos-ui-libgdx with Apache License 2.0 6 votes vote down vote up
@Override
public void show() {
    super.show();
    layout = new GlyphLayout();
    font = new NativeFont(new NativeFontPaint(25));
    font.appendText("正在加载...0123456789%");
    font.setColor(Color.BLACK);
    layout.setText(font, "正在加载...100%");

    stage = new Stage(new StretchViewport(1280, 720));

    assetManager = new AssetManager();
    assetManager.setLogger(new Logger("log", Logger.DEBUG));
    assetManager.setLoader(CocosScene.class, new CocosLoader(new InternalFileHandleResolver()));
    assetManager.load("mainscene/MenuScene.json", CocosScene.class);
}
 
Example #3
Source File: LibgdxUtils.java    From libgdx-utils with MIT License 6 votes vote down vote up
@Override
public void create() {
	try {
		logger.setLevel(Logger.DEBUG);
		Gdx.app.setLogLevel(Application.LOG_DEBUG);

		Texture.setAssetManager(assets);

		spriteBatch = new SpriteBatch();
		modelBatch = new ModelBatch();

		game.create();
	} catch (Exception e) {
		logger.error(e.getMessage(), e);
		Gdx.app.exit();
	}
}
 
Example #4
Source File: JamepadController.java    From gdx-controllerutils with Apache License 2.0 5 votes vote down vote up
private void updateAxisState() {
    for (ControllerAxis axis : ControllerAxis.values()) {
        int id = axis.ordinal();

        float value = getAxis(id);
        if (value != axisState.get(id)) {
            if (logger.getLevel() == Logger.DEBUG) {
                logger.debug("Axis [" + id + " - " + toAxis(id) + "] moved [" + value + "]");
            }
            compositeControllerListener.axisMoved(this, id, value);
        }
        axisState.put(id, value);
    }
}
 
Example #5
Source File: GdxDemo3D.java    From GdxDemo3D with Apache License 2.0 5 votes vote down vote up
@Override
public void create() {
	Gdx.app.setLogLevel(Application.LOG_DEBUG);

	getAssetManager().getLogger().setLevel(Logger.DEBUG);

	Screen currentScreen = new LoadingGameScreen(this, new GameScreen(this));
	setScreen(currentScreen);
}
 
Example #6
Source File: Assets.java    From gdx-proto with Apache License 2.0 5 votes vote down vote up
public Assets() {
	inst = this;
	manager = new AssetManager();
	manager.setErrorListener(new AssetErrorListener() {
		@Override
		public void error(AssetDescriptor assetDescriptor, Throwable throwable) {
			Log.error(assetDescriptor.toString());
			Log.error(throwable.getMessage());
		}
	});
	manager.getLogger().setLevel(Logger.DEBUG);
}