From 5a49c58458ec048a993a5bd3e81432cd286e16f5 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Mon, 6 Jul 2020 14:48:59 +0100 Subject: [PATCH] JAL-3628 Even more Cache.log.debug statements --- src/jalview/gui/AlignFrame.java | 4 ++-- src/jalview/io/BackupFiles.java | 18 ++++++++++++------ src/jalview/io/BackupFilesPresetEntry.java | 8 +++++--- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 4810a96..79c67ac 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -1208,7 +1208,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, PrintWriter out = new PrintWriter( new FileWriter(backupfiles.getTempFilePath())); - Cache.log.debug("ALIGNFRAME using temp file " + Cache.log.debug("ALIGNFRAME about to write to temp file " + backupfiles.getTempFilePath()); out.print(output); @@ -1238,7 +1238,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, backupfiles.setWriteSuccess(success); Cache.log.debug("ALIGNFRAME writing temp file was " - + (success ? "" : "not ") + "successful"); + + (success ? "" : "NOT ") + "successful"); // do the backup file roll and rename the temp file to actual file Cache.log.debug("ALIGNFRAME about to rollBackupsAndRenameTempFile"); success = backupfiles.rollBackupsAndRenameTempFile(); diff --git a/src/jalview/io/BackupFiles.java b/src/jalview/io/BackupFiles.java index d52dfbf..4f86f3d 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, true)); + boolean e = Cache.getDefault(ENABLED, true); + 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"); @@ -892,7 +898,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) -- 1.7.10.2