Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

kiwi logger can not be used with LML Basic Template #83

Open
roleyzhang opened this issue Jul 30, 2018 · 1 comment
Open

kiwi logger can not be used with LML Basic Template #83

roleyzhang opened this issue Jul 30, 2018 · 1 comment
Milestone

Comments

@roleyzhang
Copy link

Hi,
I used gdx-setup to create my testing project, I selected Kiwi from Third-party and select LML Basic from Templates. Then I import com.github.czyzby.kiwi.log.Logger; and import com.github.czyzby.kiwi.log.LoggerService; in my class and use it "private final Logger logger = LoggerService.forClass(gnk.class);¬ ". When I run my code there has a java.lang.NullPointerException. the error message is:desktop:runException in thread "main" java.lang.ExceptionInInitializerError
at citrine.gnk.gnk.(gnk.java:21)
at citrine.gnk.desktop.DesktopLauncher.createApplication(DesktopLauncher.java:15)
at citrine.gnk.desktop.DesktopLauncher.main(DesktopLauncher.java:11)
Caused by: java.lang.NullPointerException
at com.github.czyzby.kiwi.log.LoggerService.(LoggerService.java:38)
at com.github.czyzby.kiwi.log.LoggerService.(LoggerService.java:24)
... 3 more

I don't known what cause it, I used the kiwi logger successful with Autumn MVC Template.

@czyzby
Copy link
Owner

czyzby commented Jul 30, 2018

LoggerService turns on LibGDX logging in the constructor:

Gdx.app.setLogLevel(Application.LOG_DEBUG);

It basically references Gdx.app before it is initiated. For now, you should import and use the logger after the application is created.

@czyzby czyzby added this to the 1.9 milestone Jul 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants