Use JUL Logger in Main

This commit is contained in:
Florian Schmaus 2018-11-08 09:20:11 +01:00
parent a9fb09511a
commit d00518b87c

View file

@ -1,6 +1,8 @@
package de.vanitasvitae.omemoqrgenerator;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jivesoftware.smack.SmackConfiguration;
import org.jivesoftware.smack.packet.Presence;
@ -19,6 +21,8 @@ import org.jxmpp.jid.BareJid;
public class Main extends Application implements LoginCallback {
private static final Logger LOGGER = Logger.getLogger(Main.class.getName());
private Stage stage;
/*
@ -104,9 +108,10 @@ public class Main extends Application implements LoginCallback {
Map<OmemoDevice, OmemoFingerprint> fingerprints = Util.getFingerprints(connection);
ObservableList<OmemoIdentity> identities = repository.getIdentities();
LOGGER.info("Received " + identities.size() + " OMEMO identities");
for (OmemoDevice device : fingerprints.keySet()) {
identities.addAll(new OmemoIdentity(device, fingerprints.get(device)));
System.out.println(Util.twoLinesFingerprint(fingerprints.get(device)));
LOGGER.info(Util.twoLinesFingerprint(fingerprints.get(device)));
}
connection.disconnect(new Presence(Presence.Type.unavailable));
@ -121,6 +126,7 @@ public class Main extends Application implements LoginCallback {
stage.show();
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.SEVERE, "Exception in login", e);
}
}
}