package com.hammurapi.common.concurrent;

import java.util.logging.Level;
import java.util.logging.LogRecord;

/**
 * Logger for concurrent/distributed operations where logging along the execution path 
 * is more convenient than traditional class-based logging. 
 * This interface was created to mimic essential functionality of java.util.Logger class.
 * @author Pavel Vlasov
 *
 */
public interface Logger {
	
	void fine(String msg);
	void finer(String msg);
	void finest(String msg);
	void info(String msg);
	void severe(String msg);
	void warning(String msg);
	
	void log(Level level, String msg);
	void log(Level level, String msg, Object param1);
	void log(Level level, String msg, Object params[]);
	void log(Level level, String msg, Throwable thrown);
	
	void log(LogRecord record);
	
	/**
	 * Returns a sub-logger of a given logger.
	 * @param name Sub-logger name.
	 * @return
	 */
	Logger getLogger(String name);
	
	boolean isLoggable(Level level);

}
