本文整理汇总了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();
}