From 8da5b1593c0000408734e609a950fc744dafc665 Mon Sep 17 00:00:00 2001 From: Ryan Kurtz Date: Wed, 8 Feb 2023 10:51:42 -0500 Subject: [PATCH] GP-2936: Fixed an issue that prevented the default script log file from getting used in the user's.ghidra directory --- .../java/ghidra/app/util/headless/HeadlessAnalyzer.java | 6 ++++-- .../Generic/src/main/java/ghidra/framework/Application.java | 6 ++---- .../main/java/ghidra/util/classfinder/ClassSearcher.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/headless/HeadlessAnalyzer.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/headless/HeadlessAnalyzer.java index 88a9d243b0..e042e7b4b9 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/headless/HeadlessAnalyzer.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/headless/HeadlessAnalyzer.java @@ -84,8 +84,10 @@ public class HeadlessAnalyzer { * already been initialized or a headless analyzer has already been retrieved. In these cases, * the headless analyzer should be gotten with {@link HeadlessAnalyzer#getInstance()}. * - * @param logFile The desired application log file. If null, no application logging will take place. - * @param scriptLogFile The desired scripting log file. If null, no script logging will take place. + * @param logFile The desired application log file. If null, the default application log file + * will be used (see {@link Application#initializeLogging}). + * @param scriptLogFile The desired scripting log file. If null, the default scripting log file + * will be used (see {@link Application#initializeLogging}). * @param useLog4j true if log4j is to be used; otherwise, false. If this class is being used by * another tool as a library, using log4j might interfere with that tool. * @return An instance of a new headless analyzer. diff --git a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Application.java b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Application.java index 81a32e84a6..e67653b674 100644 --- a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Application.java +++ b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Application.java @@ -151,6 +151,7 @@ public class Application { /** * If the Application was previously initialized with logging disabled, this method * may be used to perform delayed logging initialization. + * * @param logFile application log file, if null the default application.log will be stored * within the user's application settings directory * @param scriptLogFile scripting log file, if null the default script.log will be stored @@ -169,10 +170,7 @@ public class Application { logFile = new File(app.layout.getUserSettingsDir(), "application.log"); } if (scriptLogFile == null) { - // Some clients pass null for the script file, as they do not support scripting. In - // that case, just have the system use the application log as the script log. This - // prevents the logging system from creating an oddly named log file. - scriptLogFile = logFile; + scriptLogFile = new File(app.layout.getUserSettingsDir(), "script.log"); } LoggingInitialization.setApplicationLogFile(logFile); diff --git a/Ghidra/Framework/Generic/src/main/java/ghidra/util/classfinder/ClassSearcher.java b/Ghidra/Framework/Generic/src/main/java/ghidra/util/classfinder/ClassSearcher.java index 8b00529b71..649d217fa4 100644 --- a/Ghidra/Framework/Generic/src/main/java/ghidra/util/classfinder/ClassSearcher.java +++ b/Ghidra/Framework/Generic/src/main/java/ghidra/util/classfinder/ClassSearcher.java @@ -254,7 +254,7 @@ public class ClassSearcher { long t = (new Date()).getTime(); - log.trace("Searching for classes..."); + log.info("Searching for classes..."); List searchPaths = gatherSearchPaths(); searcher = new ClassFinder(searchPaths, monitor);