org.mentalog
Interface Logger

All Superinterfaces:
AsynchronousLogger, LogMessageBuilder, VarargsOverloading
All Known Implementing Classes:
ExtendedDefaultLogger, Log

public interface Logger
extends VarargsOverloading, LogMessageBuilder, AsynchronousLogger

The log interface. Refer to: http://mentalog.soliveirajr.com for documentations, recipes and more.

Author:
Sergio Oliveira Jr. - sergio.oliveira.jr@gmail.com

Method Summary
 void addInterceptor(Interceptor interceptor)
          Add a log interceptor, so you can intercept the bytebuffer that is about to be written by the log.
 void close()
          Close this log.
 boolean isClosed()
          Is this log closed?
 boolean isEnabled()
          Is the log enabled, in other words, will a call to log() log anything? This method is useful if you don't want to process the log() method arguments.
 void log(Object... obj)
          Log as many objects as you want.
 void removeInterceptor(Interceptor interceptor)
          Remove a log interceptor.
 void roll()
          Roll the log file.
 
Methods inherited from interface org.mentalog.VarargsOverloading
getVarargs, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log
 
Methods inherited from interface org.mentalog.LogMessageBuilder
add, add, add, add, add, add, add, add, add, add, add, add, add, flush
 
Methods inherited from interface org.mentalog.AsynchronousLogger
close, log, roll
 

Method Detail

isEnabled

boolean isEnabled()
Is the log enabled, in other words, will a call to log() log anything? This method is useful if you don't want to process the log() method arguments. If you don't care, just call log and if the log is not enabled it will not print anything.

Returns:
true if enabled

roll

void roll()
Roll the log file. It appends -ddMMyyyy-HHmmss to the current log file and opens a new one.


log

void log(Object... obj)
Log as many objects as you want. The method toString() will be called for each object passed here unless you are using a string encoder for the object. The objects are logged with a space (' ') between them.

Parameters:
obj - The list of objects to log.

close

void close()
Close this log. If this log is file-based, the file will be closed.


isClosed

boolean isClosed()
Is this log closed?

Returns:
true if closed

addInterceptor

void addInterceptor(Interceptor interceptor)
Add a log interceptor, so you can intercept the bytebuffer that is about to be written by the log.

Parameters:
interceptor - The log interceptor

removeInterceptor

void removeInterceptor(Interceptor interceptor)
Remove a log interceptor.

Parameters:
interceptor - The log interceptor


Copyright © 2013. All Rights Reserved.