Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Writing logger adapters to orman

ahmetalpbalkan edited this page · 1 revision

You are welcomed to implement different logging system adapters for ORMAN.

All logging adapters implement the Java interface ILogger, it is like:

public interface ILogger {
    public void setLevel(LoggingLevel level);
    public void trace(String message, Object... params);
    public void debug(String message, Object... params);
    public void info(String message, Object... params);
    public void warn(String message, Object... params);
    public void error(String message, Object... params);
    public void fatal(String message, Object... params);
}

A few points to consider while implementing logging adapter:

  • You should get logging configuration in the constructor of adapter if needed.
  • You should set a default logging level in the constructor.
  • setLevel() method should keep the given level in adapter class as a field.
  • You should obey priority of logging levels and do not log events with level below the threshold (set by setLevel()) unless documented.
  • You can use String.format(message, params) to have formatted log message as String.
  • You should write Javadoc for your adapter class.
Something went wrong with that request. Please try again.