All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.mentalog.interceptor.Interceptor Maven / Gradle / Ivy

There is a newer version: 2.1.2
Show newest version
package org.mentalog.interceptor;

import java.nio.ByteBuffer;

import org.mentalog.Log;

/**
 * A interceptor interface that allows you to intercept the byte buffer before it is written to disk or console. For example, you can use this interceptor to implement SYSLOG or a log server.
 * 
 * Refer to: http://mentalog.soliveirajr.com for documentations, recipes and more.
 * 
 * @author Sergio Oliveira Jr. - [email protected]
 */
public interface Interceptor {
	
	/**
	 * The byte buffer with the log contents about to be written.
	 * 
	 * @param bb The byte buffer with the log contents.
	 * @param level the level or null if the log intercepted is not a level
	 * @return false if this log should be aborted, in other words, if you don't want this logging to happen.
	 */
	public boolean onLogBuffer(ByteBuffer bb, Log level);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy