import org.asamk.signal.util.Util;
import org.signal.zkgroup.InvalidInputException;
import org.signal.zkgroup.profiles.ProfileKey;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.whispersystems.libsignal.IdentityKeyPair;
import org.whispersystems.libsignal.state.PreKeyRecord;
import org.whispersystems.libsignal.state.SignedPreKeyRecord;
public class SignalAccount implements Closeable {
+ final static Logger logger = LoggerFactory.getLogger(SignalAccount.class);
+
private final ObjectMapper jsonProcessor = new ObjectMapper();
private final FileChannel fileChannel;
private final FileLock lock;
}
}
} catch (Exception e) {
- System.err.println(String.format("Error saving file: %s", e.getMessage()));
+ logger.error("Error saving file: {}", e.getMessage());
}
}
FileChannel fileChannel = new RandomAccessFile(new File(fileName), "rw").getChannel();
FileLock lock = fileChannel.tryLock();
if (lock == null) {
- System.err.println("Config file is in use by another instance, waiting…");
+ logger.info("Config file is in use by another instance, waiting…");
lock = fileChannel.lock();
- System.err.println("Config file lock acquired.");
+ logger.info("Config file lock acquired.");
}
return new Pair<>(fileChannel, lock);
}