logahawk
Interface Logger

All Known Implementing Classes:
AbstractLogger, BlockingQueueLogger, BufferedLogger, FilterLogger, FlattenedMultiLogger, MultiLogger, NullLogger, ProxyLogger, SeverityFilterLogger, SimpleLogger

public interface Logger

The core logging class. This class does not actually log anything, it is really a broadcaster which formats the arguments using ArgumentFormatter and SignatureFormatter and sends the formatted result to any associated Listeners which do the real logging. The purpose of this class is to be the starting point for logging. This is the class that 99% of most programs should interact with. A suggestion for implementations of this interface: provide public constructors! While many logging frameworks offer a static log manager or repository class, there are some domains where creating a Logger dynamically, not based on any configuration file or external source, is extremely useful.

See Also:
Severity

Field Summary
static String LINE_SEPARATOR
          Line separator character used for formatting multi-line messages.
 
Method Summary
 void alert(Object... data)
          Alert is an information message (like info(Object...)) but is more significant.
 void debug(Object... data)
          Debug is an developer or systems information message.
 void error(Object... data)
          Indicates a generic error occurred.
 void fatal(Object... data)
          Indicates a error occurred that halts some operation.
 void info(Object... data)
          Records nominal information about various operations.
 void log(Severity severity, Object... data)
          Logs message with a provide Severity.
 void panic(Object... data)
          Indicates a system error occurred that likely halts the entire application.
 void warn(Object... data)
          Indicates that something went wrong but the overarching process will continue.
 

Field Detail

LINE_SEPARATOR

static final String LINE_SEPARATOR
Line separator character used for formatting multi-line messages. Some formatters create multi-line values. In that situation this should be used as the line separator.

Method Detail

alert

void alert(Object... data)
Alert is an information message (like info(Object...)) but is more significant. For example the start or end of a long running process might be an alert so it stands out from the intervening info messages.

See Also:
Severity.ALERT

debug

void debug(Object... data)
Debug is an developer or systems information message. It is intended to be used by those who understand or have access to the internals of the application. Debug messages may be voluminous and so stable systems may choose to filter these out. (See SeverityFilterLogger.

See Also:
Severity.DEBUG

error

void error(Object... data)
Indicates a generic error occurred. This does not imply whether the process stopped or not, that distinction is often better served by the fatal(Object...) message.

See Also:
Severity.ERROR

fatal

void fatal(Object... data)
Indicates a error occurred that halts some operation. This is more severe than an error(Object...) but less critical than panic(Object...) message. Some applications may have no use for this and may instead rely solely on error(Object...).

See Also:
Severity.FATAL

info

void info(Object... data)
Records nominal information about various operations. This should be the most common method called.

See Also:
Severity.INFO

log

void log(Severity severity,
         Object... data)
Logs message with a provide Severity. Useful for dynamically determined Severity messages.


panic

void panic(Object... data)
Indicates a system error occurred that likely halts the entire application. This is the highest severity message, and it is likely that the application can no longer perform basic operations. Examples would be loss of all database connection, running out of temporary space (in an application that depends on it), unable to load expected classes, permission errors to core data, severe data corruption, etc. This message is akin to Severity.PANIC

warn

void warn(Object... data)
Indicates that something went wrong but the overarching process will continue. This should be used when an error state is detected but can be recovered from.

See Also:
Severity.WARN