|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.acorn.logger.log.DefaultLog
public class DefaultLog
A default implementation of Log writing to System.out and System.err.
| Field Summary |
|---|
| Fields inherited from interface org.norther.tammi.acorn.logger.log.Log |
|---|
ACCESS, DEBUG, ERROR, FATAL, INFO, INTERNAL_ERROR, LEVELS, NONE, TRACE, WARN, WARNING |
| Constructor Summary | |
|---|---|
DefaultLog()
Constructs a new log. |
|
DefaultLog(String name)
Constructs a new log for a named logger. |
|
| Method Summary | |
|---|---|
void |
access(long time,
String msg,
Object arg)
Logs an access message. |
void |
activated(LoggerEvent event)
Notifies the object that it has been activated for a logger. |
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. |
protected Localizer |
getLocalizer()
Gets the localizer. |
protected LogFactory |
getLogFactory()
Gets the log factory. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultLog()
public DefaultLog(String name)
name - the logger name.| Method Detail |
|---|
public boolean isDebug()
Log
isDebug in interface Logpublic boolean isTrace()
Log
isTrace in interface Logpublic boolean isInfo()
Log
isInfo in interface Logpublic boolean isWarn()
Log
isWarn in interface Logpublic boolean isError()
Log
isError in interface Logpublic boolean isFatal()
Log
isFatal in interface Logpublic boolean isAccess()
Log
isAccess in interface Logpublic boolean isLog(int level)
Log
isLog in interface Loglevel - the logging level.
public int getLevel()
Log
getLevel in interface Logpublic void debug(Object msg)
Log
debug in interface Logmsg - the message to log.
public void debug(String msg,
Object arg)
Log
debug in interface Logmsg - the message to log.arg - the argument or cause.public void trace(Object msg)
Log
trace in interface Logmsg - the message to log.
public void trace(String msg,
Object arg)
Log
trace in interface Logmsg - the message to log.arg - the argument or cause.public void info(Object msg)
Log
info in interface Logmsg - the message to log.
public void info(String msg,
Object arg)
Log
info in interface Logmsg - the message to log.arg - the argument or cause.public void warn(Object msg)
Log
warn in interface Logmsg - the message to log.
public void warn(String msg,
Object arg)
Log
warn in interface Logmsg - the message to log.arg - the argument or cause.
public void warn(String msg,
Object arg,
Throwable cause)
Log
warn in interface Logmsg - the message to log.arg - the argument.cause - the cause.public void error(Object msg)
Log
error in interface Logmsg - the message to log.
public void error(String msg,
Object arg)
Log
error in interface Logmsg - the message to log.arg - the argument or cause.
public void error(String msg,
Object arg,
Throwable cause)
Log
error in interface Logmsg - the message to log.arg - the argument.cause - the cause.public void fatal(Object msg)
Log
fatal in interface Logmsg - the message to log.
public void fatal(String msg,
Object arg)
Log
fatal in interface Logmsg - the message to log.arg - the argument or cause.
public void fatal(String msg,
Object arg,
Throwable cause)
Log
fatal in interface Logmsg - the message to log.arg - the argument.cause - the cause.
public void access(long time,
String msg,
Object arg)
Log
access in interface Logtime - the time of the event.msg - the message to log.arg - the argument.
public void log(int level,
Object msg)
Log
log in interface Loglevel - the level of the message.msg - the message to log.
public void log(int level,
String msg,
Object arg)
Log
log in interface Loglevel - the level of the message.msg - the message to log.arg - the argument or cause.
public void log(int level,
String msg,
Object arg,
Throwable cause)
Log
log in interface Loglevel - the level of the message.msg - the message to log.arg - the argument.cause - the cause.
public void log(int level,
long time,
String msg,
Object arg)
Log
log in interface Loglevel - the level of the message.time - the time of the event.msg - the message to log.arg - the argument or cause.
public void log(int level,
long time,
String msg,
Object arg,
Throwable cause)
Log
log in interface Loglevel - the level of the message.time - the time of the event.msg - the message to log.arg - the argument.cause - the cause.public String localize(Throwable target)
Log
localize in interface Logtarget - the exception.
public String localize(Throwable target,
Object arg)
Log
localize in interface Logtarget - the exception.arg - the argument.
public String localize(Throwable target,
Locale locale)
Log
localize in interface Logtarget - the exception.locale - the locale.
public String localize(Throwable target,
Object arg,
Locale locale)
Log
localize in interface Logtarget - the exception.arg - the argument.locale - the locale.
public String localize(Localizer localizer,
Throwable target)
Log
localize in interface Loglocalizer - the localizer.target - the exception.
public String localize(Localizer localizer,
Throwable target,
Object arg)
Log
localize in interface Loglocalizer - the localizer.target - the exception.arg - the argument.
public String localize(Localizer localizer,
Throwable target,
Locale locale)
Log
localize in interface Loglocalizer - the localizer.target - the exception.locale - the locale.
public String localize(Localizer localizer,
Throwable target,
Object arg,
Locale locale)
LogThe 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.
localize in interface Loglocalizer - the localizer.target - the exception.arg - the argument.locale - the locale.
public String getLoggerName()
Log
getLoggerName in interface Logpublic Object getLogger()
Log
getLogger in interface Logpublic Object getContext()
Log
getContext in interface Logpublic boolean isActive()
Log
isActive in interface Logpublic void activated(LoggerEvent event)
LoggerListener
activated in interface LoggerListenerevent - the logger event.protected LogFactory getLogFactory()
protected Localizer getLocalizer()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||