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 { try {
fis = new FileInputStream(archive); fis = new FileInputStream(archive);
} catch (FileNotFoundException ex) { } 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); LOGGER.debug(msg, ex);
throw new AnalysisException(msg); throw new AnalysisException(msg);
} }

View File

@@ -976,7 +976,7 @@ public class JarAnalyzer extends AbstractFileTypeAnalyzer {
final String[] l = tempFileLocation.list(); final String[] l = tempFileLocation.list();
if (l != null && l.length > 0) { if (l != null && l.length > 0) {
LOGGER.warn("Failed to delete the JAR Analyzder's temporary files from `{}`, " 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( extractArchive(new ZipArchiveInputStream(new BufferedInputStream(
fis)), destination, filter); fis)), destination, filter);
} catch (FileNotFoundException ex) { } 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); LOGGER.debug(msg, ex);
throw new ExtractionException(msg); throw new ExtractionException(msg);
} catch (IOException | ArchiveExtractionException ex) { } catch (IOException | ArchiveExtractionException ex) {
LOGGER.warn("Exception extracting archive '{}'.", archive.getName()); LOGGER.warn("Exception extracting archive '{}'.", archive.getAbsolutePath());
LOGGER.debug("", ex); LOGGER.debug("", ex);
throw new ExtractionException("Unable to extract from archive", ex); throw new ExtractionException("Unable to extract from archive", ex);
} }

View File

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