本文整理匯總了Java中org.whispersystems.libsignal.logging.SignalProtocolLogger類的典型用法代碼示例。如果您正苦於以下問題:Java SignalProtocolLogger類的具體用法?Java SignalProtocolLogger怎麽用?Java SignalProtocolLogger使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SignalProtocolLogger類屬於org.whispersystems.libsignal.logging包,在下文中一共展示了SignalProtocolLogger類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: log
import org.whispersystems.libsignal.logging.SignalProtocolLogger; //導入依賴的package包/類
@Override
public void log(int priority, String tag, String message) {
if (priority >= SignalProtocolLogger.ERROR) {
System.out.println(tag + "-" + String.valueOf(priority) + ": " + message);
}
}
示例2: start
import org.whispersystems.libsignal.logging.SignalProtocolLogger; //導入依賴的package包/類
@Override
public void start(Stage primaryStage) {
Security.insertProviderAt(new org.bouncycastle.jce.provider.BouncyCastleProvider(), 1);
SignalProtocolLoggerProvider.setProvider(new SignalProtocolLogger() {
private final Logger logger = LoggerFactory.getLogger(SignalProtocolLogger.class);
@Override
public void log(int priority, String tag, String message) {
String entry = "[{}] {}";
if(priority == SignalProtocolLogger.VERBOSE) {
logger.trace(entry, tag, message);
} else if(priority == SignalProtocolLogger.DEBUG) {
logger.debug(entry, tag, message);
} else if(priority == SignalProtocolLogger.INFO) {
logger.info(entry, tag, message);
} else if(priority == SignalProtocolLogger.WARN) {
logger.warn(entry, tag, message);
} else if(priority == SignalProtocolLogger.ERROR) {
logger.error(entry, tag, message);
} else if(priority == SignalProtocolLogger.ASSERT) {
logger.error(entry, tag, message);
}
}
});
logger.info("Signal-JDesktop starting");
instance = this;
this.primaryStage = primaryStage;
store = new DerbyStore();
signalAccount = new SignalAccountHelper();
logger.debug("Loading registration form");
try {
FXMLLoader loader = new FXMLLoader();
loader.setResources(UI_RESOURCES);
loader.setLocation(getClass().getResource("registration/Registration.fxml"));
Parent root = loader.load();
Scene scene = new Scene(root, 800, 800);
scene.getStylesheets().add("/de/thoffbauer/signal/jdesktop/application.css");
primaryStage.setScene(scene);
} catch (IOException e) {
throw new RuntimeException("Could not load registration form!", e);
}
primaryStage.show();
}