![JAR search and dependency download from the Maven repository](/logo.png)
com.asher_stern.crf.utilities.log4j.VerySimpleLayout Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of CRF Show documentation
Show all versions of CRF Show documentation
Implementation of linear-chain Conditional Random Fields (CRF) in pure Java
package com.asher_stern.crf.utilities.log4j;
import org.apache.log4j.SimpleLayout;
import org.apache.log4j.spi.LoggingEvent;
/**
* A layout for printing messages by Log4j. It prints the log message with prefix like "INFO - ", "DEBUG - ", etc.
*
* @author Asher Stern
* Date: Nov 4, 2014
*
*/
public class VerySimpleLayout extends SimpleLayout
{
public String format(LoggingEvent event)
{
stringBuffer.setLength(0);
stringBuffer.append(event.getLevel().toString()).append(" - ");
stringBuffer.append(event.getRenderedMessage());
stringBuffer.append(LINE_SEP);
return stringBuffer.toString();
}
private static final int STRING_BUFFER_INITIAL_LENGTH = 1024;
private StringBuffer stringBuffer = new StringBuffer(STRING_BUFFER_INITIAL_LENGTH);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy