package edu.cmu.cs.diamond.opendiamond;

import java.io.IOException;
import java.util.Map;
import java.util.Set;

abstract class LoggingFramework {

    public abstract void saveSearchFactory(SearchFactory searchFactory,
            Set<String> desiredAttributes) throws IOException;

    public abstract void logNoMoreResults();

    public abstract void saveGetNewResult(Result result);

    public abstract void updateStatistics(Map<String, ServerStatistics> result);

    public abstract void startedSearch();

    public abstract void stoppedSearch(Throwable cause);

    public abstract void saveSessionVariables(
            Map<String, Double> sessionVariables) throws IOException;

    public abstract void shutdown(Throwable cause);

    public static LoggingFramework createLoggingFramework(String message) throws IOException {
        return new XMLLogger(message);
    }
}
@@ -142,16 +142,844 @@
 work %7B%0A%0A
+    private static final LoggingFramework NULL_LOGGER = new LoggingFramework() %7B%0A        @Override%0A        public void updateStatistics(Map%3CString, ServerStatistics%3E result) %7B%0A        %7D%0A%0A        @Override%0A        public void stoppedSearch(Throwable cause) %7B%0A        %7D%0A%0A        @Override%0A        public void startedSearch() %7B%0A        %7D%0A%0A        @Override%0A        public void shutdown(Throwable cause) %7B%0A        %7D%0A%0A        @Override%0A        public void saveSessionVariables(Map%3CString, Double%3E sessionVariables) %7B%0A        %7D%0A%0A        @Override%0A        public void saveSearchFactory(SearchFactory searchFactory,%0A                Set%3CString%3E desiredAttributes) %7B%0A        %7D%0A%0A        @Override%0A        public void saveGetNewResult(Result result) %7B%0A        %7D%0A%0A        @Override%0A        public void logNoMoreResults() %7B%0A        %7D%0A    %7D;%0A%0A
     publ
@@ -1034,32 +1034,32 @@
  searchFactory,%0A
-
             Set%3C
@@ -1638,16 +1638,28 @@
 message)
+%0A           
  throws 
@@ -1684,42 +1684,298 @@
     
-return new XMLLogger(message);
+boolean enabled = Boolean.parseBoolean(System.getProperty(%0A                %22edu.cmu.cs.diamond.opendiamond.loggingframework.enabled%22,%0A                %22true%22));%0A%0A        if (enabled) %7B%0A            return new XMLLogger(message);%0A        %7D else %7B%0A            return NULL_LOGGER;%0A        %7D
 %0A    %7D%0A
-
 %7D
+%0A

Allow for disabling logging