org.mentalog.interceptor.Interceptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of menta-log Show documentation
Show all versions of menta-log Show documentation
A log library that embraces the kiss principle.
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);
}