org.norther.tammi.acorn.logger.log
Interface Log

All Known Implementing Classes:
DefaultLog, DomainLog

public interface Log

An interface to logging system implementations based on seevn logging levels:

Author:
Ilkka Priha

Field Summary
static int ACCESS
          The access request level.
static int DEBUG
          The debug level.
static int ERROR
          The recoverable error level.
static int FATAL
          The fatal error level.
static int INFO
          The info level.
static String INTERNAL_ERROR
          An internal error message.
static String[] LEVELS
          The string levels.
static int NONE
          The none level.
static int TRACE
          The trace level.
static int WARN
          The warn level.
static int WARNING
          The warning level.
 
Method Summary
 void access(long time, String msg, Object arg)
          Logs an access message.
 void debug(Object msg)
          Logs a debug message.
 void debug(String msg, Object arg)
          Logs a debug message with an argument.
 void error(Object msg)
          Logs an error message.
 void error(String msg, Object arg)
          Logs an error message with an argument.
 void error(String msg, Object arg, Throwable cause)
          Logs an error message with an argument and reason.
 void fatal(Object msg)
          Logs a fatal message.
 void fatal(String msg, Object arg)
          Logs a fatal message with an argument.
 void fatal(String msg, Object arg, Throwable cause)
          Logs a fatal message with an argument and reason.
 Object getContext()
          Gets the context of this log.
 int getLevel()
          Gets the log level.
 Object getLogger()
          Gets the logger of this log.
 String getLoggerName()
          Gets the logger name of this log.
 void info(Object msg)
          Logs an info message.
 void info(String msg, Object arg)
          Logs an info message with an argument.
 boolean isAccess()
          Checks whether access is enabled.
 boolean isActive()
          Checks whether this log is activated.
 boolean isDebug()
          Checks whether debug is enabled.
 boolean isError()
          Checks whether error is enabled.
 boolean isFatal()
          Checks whether fatal is enabled.
 boolean isInfo()
          Checks whether info is enabled.
 boolean isLog(int level)
          Checks whether the specified level is enabled.
 boolean isTrace()
          Checks whether trace is enabled.
 boolean isWarn()
          Checks whether warn is enabled.
 String localize(Localizer localizer, Throwable target)
          Localizes the specified exception applying the given localizer.
 String localize(Localizer localizer, Throwable target, Locale locale)
          Localizes the specified exception for the given locale applying the given localizer.
 String localize(Localizer localizer, Throwable target, Object arg)
          Localizes the specified exception with an argument applying the given localizer.
 String localize(Localizer localizer, Throwable target, Object arg, Locale locale)
          Localizes the specified exception with an argument for the given locale applying the given localizer.
 String localize(Throwable target)
          Localizes the specified exception.
 String localize(Throwable target, Locale locale)
          Localizes the specified exception for the given locale.
 String localize(Throwable target, Object arg)
          Localizes the specified exception with an argument.
 String localize(Throwable target, Object arg, Locale locale)
          Localizes the specified exception with an argument for the given locale.
 void log(int level, long time, String msg, Object arg)
          Logs a message with a specific level, date and argument.
 void log(int level, long time, String msg, Object arg, Throwable cause)
          Logs a message with a specific level, date, argument and reason.
 void log(int level, Object msg)
          Logs a message with a specific level.
 void log(int level, String msg, Object arg)
          Logs a message with a specific level and argument.
 void log(int level, String msg, Object arg, Throwable cause)
          Logs a message with a specific level, argument and reason.
 void trace(Object msg)
          Logs a trace message.
 void trace(String msg, Object arg)
          Logs a trace message with an argument.
 void warn(Object msg)
          Logs a warn message.
 void warn(String msg, Object arg)
          Logs a warn message with an argument.
 void warn(String msg, Object arg, Throwable cause)
          Logs a warn message with an argument and reason.
 

Field Detail

INTERNAL_ERROR

static final String INTERNAL_ERROR
An internal error message.

See Also:
Constant Field Values

NONE

static final int NONE
The none level.

See Also:
Constant Field Values

DEBUG

static final int DEBUG
The debug level.

See Also:
Constant Field Values

TRACE

static final int TRACE
The trace level.

See Also:
Constant Field Values

INFO

static final int INFO
The info level.

See Also:
Constant Field Values

WARN

static final int WARN
The warn level.

See Also:
Constant Field Values

WARNING

static final int WARNING
The warning level.

See Also:
Constant Field Values

ERROR

static final int ERROR
The recoverable error level.

See Also:
Constant Field Values

FATAL

static final int FATAL
The fatal error level.

See Also:
Constant Field Values

ACCESS

static final int ACCESS
The access request level.

See Also:
Constant Field Values

LEVELS

static final String[] LEVELS
The string levels.

Method Detail

isDebug

boolean isDebug()
Checks whether debug is enabled.

Returns:
true if enabled, false otherwise.

isTrace

boolean isTrace()
Checks whether trace is enabled.

Returns:
true if enabled, false otherwise.

isInfo

boolean isInfo()
Checks whether info is enabled.

Returns:
true if enabled, false otherwise.

isWarn

boolean isWarn()
Checks whether warn is enabled.

Returns:
true if enabled, false otherwise.

isError

boolean isError()
Checks whether error is enabled.

Returns:
true if enabled, false otherwise.

isFatal

boolean isFatal()
Checks whether fatal is enabled.

Returns:
true if enabled, false otherwise.

isAccess

boolean isAccess()
Checks whether access is enabled.

Returns:
true if enabled, false otherwise.

isLog

boolean isLog(int level)
Checks whether the specified level is enabled.

Parameters:
level - the logging level.
Returns:
true if enabled, false otherwise.

getLevel

int getLevel()
Gets the log level.

Returns:
the logging level.

debug

void debug(Object msg)
Logs a debug message.

Parameters:
msg - the message to log.

debug

void debug(String msg,
           Object arg)
Logs a debug message with an argument.

Parameters:
msg - the message to log.
arg - the argument or cause.

trace

void trace(Object msg)
Logs a trace message.

Parameters:
msg - the message to log.

trace

void trace(String msg,
           Object arg)
Logs a trace message with an argument.

Parameters:
msg - the message to log.
arg - the argument or cause.

info

void info(Object msg)
Logs an info message.

Parameters:
msg - the message to log.

info

void info(String msg,
          Object arg)
Logs an info message with an argument.

Parameters:
msg - the message to log.
arg - the argument or cause.

warn

void warn(Object msg)
Logs a warn message.

Parameters:
msg - the message to log.

warn

void warn(String msg,
          Object arg)
Logs a warn message with an argument.

Parameters:
msg - the message to log.
arg - the argument or cause.

warn

void warn(String msg,
          Object arg,
          Throwable cause)
Logs a warn message with an argument and reason.

Parameters:
msg - the message to log.
arg - the argument.
cause - the cause.

error

void error(Object msg)
Logs an error message.

Parameters:
msg - the message to log.

error

void error(String msg,
           Object arg)
Logs an error message with an argument.

Parameters:
msg - the message to log.
arg - the argument or cause.

error

void error(String msg,
           Object arg,
           Throwable cause)
Logs an error message with an argument and reason.

Parameters:
msg - the message to log.
arg - the argument.
cause - the cause.

fatal

void fatal(Object msg)
Logs a fatal message.

Parameters:
msg - the message to log.

fatal

void fatal(String msg,
           Object arg)
Logs a fatal message with an argument.

Parameters:
msg - the message to log.
arg - the argument or cause.

fatal

void fatal(String msg,
           Object arg,
           Throwable cause)
Logs a fatal message with an argument and reason.

Parameters:
msg - the message to log.
arg - the argument.
cause - the cause.

access

void access(long time,
            String msg,
            Object arg)
Logs an access message.

Parameters:
time - the time of the event.
msg - the message to log.
arg - the argument.

log

void log(int level,
         Object msg)
Logs a message with a specific level.

Parameters:
level - the level of the message.
msg - the message to log.

log

void log(int level,
         String msg,
         Object arg)
Logs a message with a specific level and argument.

Parameters:
level - the level of the message.
msg - the message to log.
arg - the argument or cause.

log

void log(int level,
         String msg,
         Object arg,
         Throwable cause)
Logs a message with a specific level, argument and reason.

Parameters:
level - the level of the message.
msg - the message to log.
arg - the argument.
cause - the cause.

log

void log(int level,
         long time,
         String msg,
         Object arg)
Logs a message with a specific level, date and argument.

Parameters:
level - the level of the message.
time - the time of the event.
msg - the message to log.
arg - the argument or cause.

log

void log(int level,
         long time,
         String msg,
         Object arg,
         Throwable cause)
Logs a message with a specific level, date, argument and reason.

Parameters:
level - the level of the message.
time - the time of the event.
msg - the message to log.
arg - the argument.
cause - the cause.

localize

String localize(Throwable target)
Localizes the specified exception.

Parameters:
target - the exception.
Returns:
the localized message.

localize

String localize(Throwable target,
                Object arg)
Localizes the specified exception with an argument.

Parameters:
target - the exception.
arg - the argument.
Returns:
the localized message.

localize

String localize(Throwable target,
                Locale locale)
Localizes the specified exception for the given locale.

Parameters:
target - the exception.
locale - the locale.
Returns:
the localized message.

localize

String localize(Throwable target,
                Object arg,
                Locale locale)
Localizes the specified exception with an argument for the given locale.

Parameters:
target - the exception.
arg - the argument.
locale - the locale.
Returns:
the localized message.

localize

String localize(Localizer localizer,
                Throwable target)
Localizes the specified exception applying the given localizer.

Parameters:
target - the exception.
localizer - the localizer.
Returns:
the localized message.

localize

String localize(Localizer localizer,
                Throwable target,
                Object arg)
Localizes the specified exception with an argument applying the given localizer.

Parameters:
target - the exception.
arg - the argument.
localizer - the localizer.
Returns:
the localized message.

localize

String localize(Localizer localizer,
                Throwable target,
                Locale locale)
Localizes the specified exception for the given locale applying the given localizer.

Parameters:
target - the exception.
locale - the locale.
localizer - the localizer.
Returns:
the localized message.

localize

String localize(Localizer localizer,
                Throwable target,
                Object arg,
                Locale locale)
Localizes the specified exception with an argument for the given locale applying the given localizer.

The message is constructed by using the exception type and non-localized message as a key for the localized message. If such a message can't be found, the plain exception type is used as the key. If such a message is found and it ends with a colon, the non-localized message is appended to it. If such a message is not found, the non-localized message is returned unmodified.

Parameters:
target - the exception.
arg - the argument.
locale - the locale.
localizer - the localizer.
Returns:
the localized message.

getLoggerName

String getLoggerName()
Gets the logger name of this log.

Returns:
the logger name.

getLogger

Object getLogger()
Gets the logger of this log.

Returns:
the logger.

getContext

Object getContext()
Gets the context of this log.

Returns:
the context.

isActive

boolean isActive()
Checks whether this log is activated.

Returns:
true if activated, false otherwise.


Copyright © 2004 The Norther Organization. All rights reserved.