Skip to content

Commit

Permalink
suppress No etc/terrier.properties message #252
Browse files Browse the repository at this point in the history
  • Loading branch information
cmacdonald authored Aug 22, 2024
2 parents ca96294 + bb91ad6 commit 4fceb28
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ public interface TerrierApplicationPlugin
public static void bootstrapInitialisation()
{
useContext = Boolean.parseBoolean(System.getProperty("terrier.usecontext", "false"));
// we dont have a logger configured at this stage, so we can use this System property
boolean debug = Boolean.parseBoolean(System.getProperty("terrier.debug.config", "false"));

String propertiesFile = null;
String terrier_home = null;
Expand Down Expand Up @@ -346,13 +348,14 @@ public static void bootstrapInitialisation()
else //we will need to hunt for the terrier.properties file
{
terrier_home = System.getProperty("terrier.home", ".");

terrier_etc = System.getProperty("terrier.etc", terrier_home +FILE_SEPARATOR+"etc");
propertiesFile = System.getProperty("terrier.setup", terrier_etc + FILE_SEPARATOR+"terrier.properties");
}

if (new File(propertiesFile).exists())
{
if (debug)
System.err.println("Using terrier.properties file at" + propertiesFile + " for configuration");
clearAllProperties();
TERRIER_HOME = getProperty("terrier.home", terrier_home);
FileInputStream in = new FileInputStream(propertiesFile);
Expand All @@ -364,7 +367,8 @@ public static void bootstrapInitialisation()
terrier_etc = System.getProperty("terrier.etc", ".");
ClassLoader clz = ApplicationSetup.class.getClassLoader();
List<InputStream> resources = loadResources("terrier.default.properties", clz);
System.err.println("No etc/terrier.properties, using terrier.default.properties for bootstrap configuration.");
if (debug)
System.err.println("No etc/terrier.properties, using terrier.default.properties for bootstrap configuration.");
configure(resources.toArray(new InputStream[0]));
for(InputStream in : resources) {
in.close();
Expand Down

0 comments on commit 4fceb28

Please sign in to comment.