001 002package io.cui.tools.logging; 003 004import java.util.function.Supplier; 005 006/** 007 * Provides additional information for simplifying logging 008 * 009 * @author Oliver Wolff 010 * 011 */ 012public interface LogRecord { 013 014 /** 015 * @return the prefix for identifying the log-entry, e.g. 'CUI' 016 */ 017 String getPrefix(); 018 019 /** 020 * @return the identifier for the concrete entry, e.g. '100' 021 */ 022 Integer getIdentifier(); 023 024 /** 025 * @return The message template for creating the log-message 026 */ 027 String getTemplate(); 028 029 /** 030 * Returns a {@link Supplier} view on the formatter 031 * 032 * @param parameter optional, used for filling the template 033 * @return a {@link Supplier} view on the formatter 034 */ 035 Supplier<String> supplier(Object... parameter); 036 037 /** 038 * Formats the template with the given object. <em>Important:</em> it implicitly prepends the 039 * identifier, e.g. "CUI-100: " in front of the created message. 040 * 041 * @param parameter optional, used for filling the template 042 * @return the formated String. 043 */ 044 String format(Object... parameter); 045 046 /** 047 * @return the concatenated identifier String, e.g. CUI-100 048 */ 049 String resolveIdentifierString(); 050 051}