001 package log; 002 003 /** 004 * An object that can be logged. 005 * 006 * <p>When a Loggable object is handed to {@link Log#log}, its {@link #getLogData} 007 * method will be called to create a {@link LogEntry} describing the given object.</p> 008 * 009 * @see Log#log 010 * @see LogEntry 011 * 012 * @author Steffen Zschaler 013 * @version 1.0 014 * @since v1.0 015 */ 016 public interface Loggable { 017 018 /** 019 * Called when the object is being logged. 020 * 021 * <p>Should return a fresh instance of a subclass of {@link log.LogEntry} describing the object 022 * or event to be logged.</p> 023 * 024 * @return the data to be stored in the log file. 025 * 026 * @override Always 027 */ 028 public LogEntry getLogData(); 029 }