package beast.core;

import java.io.PrintStream;

/**
 * @author Andrew Rambaut
 * @version $Id$
 */

/**
 * interface for items that can be logged through a Logger *
 */
public interface Loggable {

    /**
     * write header information, e.g. labels of a parameter,
     * or Nexus tree preamble
     *
     * @param out log stream
     */
    void init(PrintStream out);

    /**
     * log this sample for current state to PrintStream,
     * e.g. value of a parameter, list of parameters or Newick tree
     *
     * @param sample chain sample number
     * @param out     log stream
     */
    void log(long sample, PrintStream out);

    /**
     * close log. An end of log message can be left (as in End; for Nexus trees)
     *
     * @param out log stream
     */
    void close(PrintStream out);
}

@@ -591,24 +591,32 @@
      */%0A    
+default 
 void log(lon
@@ -633,34 +633,364 @@
 PrintStream out)
-;%0A
+ %7B%0A    %09if (sample %3C Integer.MAX_VALUE) %7B%0A    %09%09log((int) sample, out);%0A    %09%7D%0A    %7D%0A    %0A    /** For backward compatibility only: the int-version of log().%0A     * %0A     * Please use log(long sample, PrintStream out) instead of log(int, PrintStream)%0A     */%0A    @Deprecated %0A    default void log(int sample, PrintStream out) %7B%7D%0A    
 %0A    /**%0A     * 

update Loggable for backward compatibility #554