19 package org.sleuthkit.autopsy.coreutils;
21 import java.util.concurrent.ExecutionException;
22 import java.util.logging.Level;
23 import javafx.concurrent.Task;
24 import org.openide.util.Cancellable;
29 public abstract class LoggedTask<T>
extends Task<T> implements Cancellable {
35 public LoggedTask(String taskName,
boolean logStateChanges) {
36 updateTitle(taskName);
43 if (logStateChanges) {
51 LOGGER.log(Level.SEVERE, getTitle() +
" failed!", getException());
58 if (logStateChanges) {
68 }
catch (InterruptedException | ExecutionException ex) {
69 LOGGER.log(Level.SEVERE, getTitle() +
" threw unexpected exception: ", ex);
71 if (logStateChanges) {
final boolean logStateChanges
LoggedTask(String taskName, boolean logStateChanges)
synchronized static Logger getLogger(String name)
static final Logger LOGGER