From: Ben Soares Date: Mon, 6 Jul 2020 13:48:59 +0000 (+0100) Subject: JAL-3628 Even more Cache.log.debug statements X-Git-Tag: Develop-2_11_2_0-d20201215~15^2~34 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6c9f1f0278e44bdb3d777c0e4227c22fa09425bf;p=jalview.git JAL-3628 Even more Cache.log.debug statements --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 5b7a201..9658abf 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -1301,7 +1301,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, if (backupfiles != null) { - Cache.log.debug("ALIGNFRAME using temp file " + Cache.log.debug("ALIGNFRAME about to write to temp file " + backupfiles.getTempFilePath()); } @@ -1335,7 +1335,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { backupfiles.setWriteSuccess(lastSaveSuccessful); Cache.log.debug("ALIGNFRAME writing temp file was " - + (lastSaveSuccessful ? "" : "not ") + "successful"); + + (lastSaveSuccessful ? "" : "NOT ") + "successful"); // do the backup file roll and rename the temp file to actual file Cache.log.debug( "ALIGNFRAME about to rollBackupsAndRenameTempFile"); diff --git a/src/jalview/io/BackupFiles.java b/src/jalview/io/BackupFiles.java index 91cc5fa..5594857 100644 --- a/src/jalview/io/BackupFiles.java +++ b/src/jalview/io/BackupFiles.java @@ -132,10 +132,12 @@ public class BackupFiles String tempfilename = file.getName(); File tempdir = file.getParentFile(); Cache.log.debug( - "BACKUPFILES [file!=null] attempting to create temp file " + "BACKUPFILES [file!=null] attempting to create temp file for " + tempfilename + " in dir " + tempdir); temp = File.createTempFile(tempfilename, TEMP_FILE_EXT + newTempFileSuffix, tempdir); + Cache.log.debug( + "BACKUPFILES using temp file " + temp.getAbsolutePath()); } else { @@ -162,10 +164,14 @@ public class BackupFiles public static void classInit() { Cache.log.debug("BACKUPFILES classInit"); - setEnabled(Cache.getDefault(ENABLED, !Platform.isJS())); + boolean e = Cache.getDefault(ENABLED, !Platform.isJS()); + setEnabled(e); + Cache.log.debug("BACKUPFILES " + (e ? "enabled" : "disabled")); BackupFilesPresetEntry bfpe = BackupFilesPresetEntry .getSavedBackupEntry(); + Cache.log.debug("BACKUPFILES preset scheme " + bfpe.toString()); setConfirmDelete(bfpe.confirmDelete); + Cache.log.debug("BACKUPFILES confirm delete " + bfpe.confirmDelete); } public static void setEnabled(boolean flag) @@ -544,9 +550,9 @@ public class BackupFiles Cache.log.debug("BACKUPFILES Moving old file [" + file + "] to latestBackupFilename [" + latestBackupFilename + "]"); ret |= moveFileToFile(file, new File(latestBackupFilename)); - Cache.log.debug("BACKUPFILES moving " + latestBackupFilename + " to " - + file + " was " + (ret ? "" : "NOT ") + "successful"); - + Cache.log.debug( + "BACKUPFILES moving " + file + " to " + latestBackupFilename + + " was " + (ret ? "" : "NOT ") + "successful"); if (tidyUp) { Cache.log.debug("BACKUPFILES tidying up files"); @@ -891,7 +897,7 @@ public class BackupFiles + " to " + newFile.getAbsolutePath()); Files.move(oldPath, newPath, StandardCopyOption.REPLACE_EXISTING); ret = true; - Cache.log.debug("BACKUPFILES move seemse to have succeeded"); + Cache.log.debug("BACKUPFILES move seems to have succeeded"); } catch (IOException e) { Cache.log.warn("Could not move file '" + oldPath.toString() + "' to '" diff --git a/src/jalview/io/BackupFilesPresetEntry.java b/src/jalview/io/BackupFilesPresetEntry.java index 69130d0..0734665 100644 --- a/src/jalview/io/BackupFilesPresetEntry.java +++ b/src/jalview/io/BackupFilesPresetEntry.java @@ -20,13 +20,13 @@ */ package jalview.io; -import jalview.bin.Cache; -import jalview.util.MessageManager; - import java.util.HashMap; import java.util.Map; import java.util.StringTokenizer; +import jalview.bin.Cache; +import jalview.util.MessageManager; + public class BackupFilesPresetEntry { @@ -135,6 +135,8 @@ public class BackupFilesPresetEntry { String savedPresetString = Cache .getDefault(BackupFilesPresetEntry.SAVEDCONFIG, null); + Cache.log.debug("BACKUPFILESPRESETENTRY saved preset string is " + + savedPresetString); BackupFilesPresetEntry savedPreset = BackupFilesPresetEntry .createBackupFilesPresetEntry(savedPresetString); if (savedPreset == null)