updated logging

This commit is contained in:
Jeremy Long
2018-01-21 09:35:13 -05:00
parent 275d1bdbf9
commit 40f70c257d
4 changed files with 5 additions and 4 deletions

View File

@@ -389,7 +389,7 @@ public class ArchiveAnalyzer extends AbstractFileTypeAnalyzer {
try {
fis = new FileInputStream(archive);
} catch (FileNotFoundException ex) {
final String msg = String.format("Error extracting file `%s`: %s", archive.toString(), ex.getMessage());
final String msg = String.format("Error extracting file `%s`: %s", archive.getAbsolutePath(), ex.getMessage());
LOGGER.debug(msg, ex);
throw new AnalysisException(msg);
}

View File

@@ -976,7 +976,7 @@ public class JarAnalyzer extends AbstractFileTypeAnalyzer {
final String[] l = tempFileLocation.list();
if (l != null && l.length > 0) {
LOGGER.warn("Failed to delete the JAR Analyzder's temporary files from `{}`, "
+ "see the log for more details", tempFileLocation.toString());
+ "see the log for more details", tempFileLocation.getAbsolutePath());
}
}
}

View File

@@ -139,11 +139,11 @@ public final class ExtractionUtil {
extractArchive(new ZipArchiveInputStream(new BufferedInputStream(
fis)), destination, filter);
} catch (FileNotFoundException ex) {
final String msg = String.format("Error extracting file `%s` with filter: %s",archive.toString(), ex.getMessage());
final String msg = String.format("Error extracting file `%s` with filter: %s", archive.getAbsolutePath(), ex.getMessage());
LOGGER.debug(msg, ex);
throw new ExtractionException(msg);
} catch (IOException | ArchiveExtractionException ex) {
LOGGER.warn("Exception extracting archive '{}'.", archive.getName());
LOGGER.warn("Exception extracting archive '{}'.", archive.getAbsolutePath());
LOGGER.debug("", ex);
throw new ExtractionException("Unable to extract from archive", ex);
}

View File

@@ -98,6 +98,7 @@ public final class FileUtils {
if (!tempDir.mkdirs()) {
throw new IOException("Could not create temp directory `" + tempDir.getAbsolutePath() + "`");
}
LOGGER.debug("Temporary directory is `{}`", tempDir.getAbsolutePath());
return tempDir;
}