Commit fb5f12a9 authored by Jonathan CLARKE's avatar Jonathan CLARKE
Browse files

Use private field and accessors instead of public field. References #198.

parent dc46e3dc
......@@ -89,7 +89,7 @@ public class Configuration {
public static String location = PROPERTIES_FILENAME;
/** Flag to detect if logging is configured or not yet */
public static boolean loggingSetup = false;
private static boolean loggingSetup = false;
// People DN
public static String DN_PEOPLE = "ou=People";
......@@ -492,7 +492,7 @@ public class Configuration {
}
// Logging configured
loggingSetup = true;
setLoggingSetup(true);
// WARNING: don't log anything before HERE!
LOGGER.debug("Reading configuration from {}", Configuration.getConfigurationDirectory());
......@@ -511,4 +511,22 @@ public class Configuration {
throw new RuntimeException("No " + propertyName + " property specified in " + location + ". Aborting.");
}
}
/**
* Set the flag to determine if logging is configured or not yet
*
* @param loggingSetup Is logging setup yet?
*/
public static void setLoggingSetup(boolean loggingSetup) {
Configuration.loggingSetup = loggingSetup;
}
/**
* Get the flag to determine if logging is configured or not yet
*
* @return boolean loggingSetup
*/
public static boolean isLoggingSetup() {
return loggingSetup;
}
}
......@@ -122,7 +122,7 @@ public final class Launcher {
// Wrap the launcher
obj.run();
} catch (Exception e) {
if (!Configuration.loggingSetup) {
if (!Configuration.isLoggingSetup()) {
System.err.println("Error: " + e.getMessage());
} else {
LOGGER.error(e.toString());
......@@ -150,7 +150,7 @@ public final class Launcher {
// do the work!
sync.launch(syncType, cleanType);
} catch (Exception e) {
if (!Configuration.loggingSetup) {
if (!Configuration.isLoggingSetup()) {
System.err.println("Error: " + e.getMessage());
} else {
LOGGER.error(e.toString());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment