mirror of
https://github.com/vanitasvitae/OmemoQRCodeGenerator.git
synced 2024-11-27 06:42:07 +01:00
Use JUL Logger in Main
This commit is contained in:
parent
a9fb09511a
commit
d00518b87c
1 changed files with 7 additions and 1 deletions
|
@ -1,6 +1,8 @@
|
||||||
package de.vanitasvitae.omemoqrgenerator;
|
package de.vanitasvitae.omemoqrgenerator;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.jivesoftware.smack.SmackConfiguration;
|
import org.jivesoftware.smack.SmackConfiguration;
|
||||||
import org.jivesoftware.smack.packet.Presence;
|
import org.jivesoftware.smack.packet.Presence;
|
||||||
|
@ -19,6 +21,8 @@ import org.jxmpp.jid.BareJid;
|
||||||
|
|
||||||
public class Main extends Application implements LoginCallback {
|
public class Main extends Application implements LoginCallback {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = Logger.getLogger(Main.class.getName());
|
||||||
|
|
||||||
private Stage stage;
|
private Stage stage;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -104,9 +108,10 @@ public class Main extends Application implements LoginCallback {
|
||||||
Map<OmemoDevice, OmemoFingerprint> fingerprints = Util.getFingerprints(connection);
|
Map<OmemoDevice, OmemoFingerprint> fingerprints = Util.getFingerprints(connection);
|
||||||
|
|
||||||
ObservableList<OmemoIdentity> identities = repository.getIdentities();
|
ObservableList<OmemoIdentity> identities = repository.getIdentities();
|
||||||
|
LOGGER.info("Received " + identities.size() + " OMEMO identities");
|
||||||
for (OmemoDevice device : fingerprints.keySet()) {
|
for (OmemoDevice device : fingerprints.keySet()) {
|
||||||
identities.addAll(new OmemoIdentity(device, fingerprints.get(device)));
|
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));
|
connection.disconnect(new Presence(Presence.Type.unavailable));
|
||||||
|
@ -121,6 +126,7 @@ public class Main extends Application implements LoginCallback {
|
||||||
stage.show();
|
stage.show();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
LOGGER.log(Level.SEVERE, "Exception in login", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue