use of com.canoo.platform.logger.client.widgets.LogFilterView in project dolphin-platform by canoo.
the class ViewSample method start.
@Override
public void start(final Stage primaryStage) throws Exception {
final ListView<LogMessage> listView = new ListView<>();
listView.setCellFactory(v -> new LogListCell());
listView.setItems(LogClientUtil.createObservableListFromLocalCache());
Executors.newSingleThreadExecutor().execute(() -> {
while (true) {
try {
Thread.sleep(2_000);
} catch (InterruptedException e) {
}
LOG.info(MarkerFactory.getMarker("MyMarker"), "System " + UUID.randomUUID() + " starting");
LOG.info("Found 3 modules");
LOG.debug("Starting module 'Base'");
if (Math.random() > 0.5) {
LOG.trace("Module 'Base' started in 45 ms");
} else {
LOG.trace("Module 'Base' is using default configuration");
LOG.trace("Module 'Base' started in 67 ms");
}
LOG.debug("Starting module 'Platform'");
if (Math.random() > 0.5) {
LOG.trace("Module 'Platform' started in 35 ms");
} else {
LOG.warn("Module 'Platform' is using default configuration! Please configure it!");
LOG.trace("Module 'Platform' started in 67 ms");
}
LOG.debug("Starting module 'Security'");
if (Math.random() > 0.5) {
LOG.trace("Module 'Security' started in 35 ms");
} else {
LOG.error("Module 'Security' can not be started!", new RuntimeException("Error in param foo"));
}
}
});
Executors.newSingleThreadExecutor().execute(() -> {
while (true) {
try {
Thread.sleep(1_500);
} catch (InterruptedException e) {
}
LOG.trace("Will ping server");
LOG.debug("Server ping returned in 42 ms");
}
});
final LogFilterView filterView = new LogFilterView();
final VBox main = new VBox(filterView, listView);
main.setFillWidth(true);
VBox.setVgrow(filterView, Priority.NEVER);
VBox.setVgrow(listView, Priority.ALWAYS);
primaryStage.setScene(new Scene(main));
primaryStage.show();
}
Aggregations