public abstract class Logger
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Logger.LogLevel
These indicate the verbosity levels for calls to log() *
|
static class |
Logger.OSThread |
Modifier and Type | Field and Description |
---|---|
static int |
DEBUG
Deprecated.
|
static int |
ERROR
Deprecated.
|
static int |
INTERNAL
Deprecated.
|
static int |
MINOR
Deprecated.
|
static int |
NORMAL
Deprecated.
|
static int |
WARNING
Deprecated.
|
Constructor and Description |
---|
Logger() |
Modifier and Type | Method and Description |
---|---|
static void |
debug(java.lang.Class<?> c,
java.lang.String s) |
static void |
debug(java.lang.Class<?> c,
java.lang.String s,
java.lang.Throwable t) |
static void |
debug(java.lang.Object o,
java.lang.String s) |
static void |
debug(java.lang.Object o,
java.lang.String s,
java.lang.Throwable t) |
static void |
destroyChainIfEmpty()
If no logger hooks are registered, destroy the global logger hook
chain by replacing it with a VoidLogger, which simply ignores
everything logged.
|
static void |
error(java.lang.Class<?> c,
java.lang.String s) |
static void |
error(java.lang.Class<?> c,
java.lang.String s,
java.lang.Throwable t) |
static void |
error(java.lang.Object o,
java.lang.String s) |
static void |
error(java.lang.Object o,
java.lang.String s,
java.lang.Throwable e) |
static void |
fatal(java.lang.Object cause,
int retcode,
java.lang.String message)
Report a fatal error and exit.
|
static LoggerHookChain |
getChain()
Get the global logger hook chain, creating it if necessary.
|
int |
getThreshold()
Deprecated.
|
abstract Logger.LogLevel |
getThresholdNew() |
static void |
globalAddHook(LoggerHook logger2)
Add a logger hook to the global logger hook chain.
|
static int |
globalGetThreshold()
Deprecated.
|
static Logger.LogLevel |
globalGetThresholdNew()
What is the current global logging threshold?
|
static void |
globalRemoveHook(LoggerHook hook)
Remove a logger hook from the global logger hook chain.
|
static void |
globalSetThreshold(int i)
Deprecated.
|
static void |
globalSetThreshold(Logger.LogLevel i)
Set the global threshold.
|
abstract void |
instanceRegisterLogThresholdCallback(LogThresholdCallback ltc)
Register a log threshold callback with this specific logger, not with
the global logger.
|
boolean |
instanceShouldLog(int priority,
java.lang.Class<?> c)
Deprecated.
|
boolean |
instanceShouldLog(int prio,
java.lang.Object o)
Deprecated.
|
abstract boolean |
instanceShouldLog(Logger.LogLevel priority,
java.lang.Class<?> c)
Should this specific Logger object log a message concerning the
given class with the given priority.
|
abstract boolean |
instanceShouldLog(Logger.LogLevel prio,
java.lang.Object o)
Should this specific Logger object log a message concerning the
given object with the given priority.
|
abstract void |
instanceUnregisterLogThresholdCallback(LogThresholdCallback ltc)
Unregister a log threshold callback with this specific logger.
|
void |
log(java.lang.Class<?> c,
java.lang.String message,
int priority)
Deprecated.
|
abstract void |
log(java.lang.Class<?> c,
java.lang.String message,
Logger.LogLevel priority)
Log a message from static code.
|
void |
log(java.lang.Class<?> c,
java.lang.String message,
java.lang.Throwable e,
int priority)
Deprecated.
|
abstract void |
log(java.lang.Class<?> c,
java.lang.String message,
java.lang.Throwable e,
Logger.LogLevel priority)
Log a message from static code.
|
void |
log(java.lang.Object o,
java.lang.Class<?> source,
java.lang.String message,
java.lang.Throwable e,
int priority)
Deprecated.
|
abstract void |
log(java.lang.Object o,
java.lang.Class<?> source,
java.lang.String message,
java.lang.Throwable e,
Logger.LogLevel priority)
Log a message
|
void |
log(java.lang.Object source,
java.lang.String message,
int priority)
Deprecated.
|
abstract void |
log(java.lang.Object source,
java.lang.String message,
Logger.LogLevel priority)
Log a message.
|
void |
log(java.lang.Object o,
java.lang.String message,
java.lang.Throwable e,
int priority)
Deprecated.
|
abstract void |
log(java.lang.Object o,
java.lang.String message,
java.lang.Throwable e,
Logger.LogLevel priority)
Log a message with an exception.
|
static void |
logStatic(java.lang.Object o,
java.lang.String s,
int prio)
Deprecated.
|
static void |
logStatic(java.lang.Object o,
java.lang.String s,
Logger.LogLevel prio) |
static void |
logStatic(java.lang.Object o,
java.lang.String s,
java.lang.Throwable e,
Logger.LogLevel prio) |
static void |
minor(java.lang.Class<?> c,
java.lang.String s) |
static void |
minor(java.lang.Class<?> class1,
java.lang.String string,
java.lang.Throwable t) |
static void |
minor(java.lang.Object o,
java.lang.String s) |
static void |
minor(java.lang.Object o,
java.lang.String s,
java.lang.Throwable t) |
static void |
normal(java.lang.Class<?> c,
java.lang.String s) |
static void |
normal(java.lang.Class<?> c,
java.lang.String s,
java.lang.Throwable t) |
static void |
normal(java.lang.Object o,
java.lang.String s) |
static void |
normal(java.lang.Object o,
java.lang.String s,
java.lang.Throwable t) |
static void |
registerClass(java.lang.Class<?> clazz)
Register a class so that its logMINOR and logDEBUG fields (the
latter is optional) are automatically updated whenever they should be
i.e.
|
static void |
registerLogThresholdCallback(LogThresholdCallback ltc)
Register a LogThresholdCallback; this callback will be called after registration,
and whether the overall threshold or the detailed thresholds change in a way that
would affect whether messages for the class registering will be logged.
|
abstract void |
setDetailedThresholds(java.lang.String details)
Set the detailed list of thresholds.
|
void |
setThreshold(int thresh)
Deprecated.
|
abstract void |
setThreshold(Logger.LogLevel thresh)
Changes the priority threshold.
|
abstract void |
setThreshold(java.lang.String symbolicThreshold)
Changes the priority threshold.
|
static void |
setupChain()
Create a LoggerHookChain and set the global logger to be it.
|
static FileLoggerHook |
setupStdoutLogging(int level,
java.lang.String detail)
Deprecated.
|
static FileLoggerHook |
setupStdoutLogging(Logger.LogLevel level,
java.lang.String detail)
Log to standard output.
|
static boolean |
shouldLog(int priority,
java.lang.Class<?> c)
Deprecated.
|
static boolean |
shouldLog(int priority,
java.lang.Object o)
Deprecated.
|
static boolean |
shouldLog(Logger.LogLevel priority,
java.lang.Class<?> c)
Would a message concerning an object of the given class be logged
at the given priority by the global logger?
|
static boolean |
shouldLog(Logger.LogLevel priority,
java.lang.Object o)
Would a message concerning the given object be logged
at the given priority by the global logger?
|
static void |
unregisterLogThresholdCallback(LogThresholdCallback ltc)
Register a LogThresholdCallback; this callback will be called after registration
|
static void |
warning(java.lang.Class<?> c,
java.lang.String s) |
static void |
warning(java.lang.Class<?> c,
java.lang.String s,
java.lang.Throwable t) |
static void |
warning(java.lang.Object o,
java.lang.String s) |
static void |
warning(java.lang.Object o,
java.lang.String s,
java.lang.Throwable e) |
@Deprecated public static final int ERROR
@Deprecated public static final int WARNING
@Deprecated public static final int NORMAL
@Deprecated public static final int MINOR
@Deprecated public static final int DEBUG
@Deprecated public static final int INTERNAL
public static FileLoggerHook setupStdoutLogging(Logger.LogLevel level, java.lang.String detail) throws LoggerHook.InvalidThresholdException
@Deprecated public static FileLoggerHook setupStdoutLogging(int level, java.lang.String detail) throws LoggerHook.InvalidThresholdException
public static void setupChain()
public static void debug(java.lang.Class<?> c, java.lang.String s)
public static void debug(java.lang.Class<?> c, java.lang.String s, java.lang.Throwable t)
public static void debug(java.lang.Object o, java.lang.String s)
public static void debug(java.lang.Object o, java.lang.String s, java.lang.Throwable t)
public static void error(java.lang.Class<?> c, java.lang.String s)
public static void error(java.lang.Class<?> c, java.lang.String s, java.lang.Throwable t)
public static void error(java.lang.Object o, java.lang.String s)
public static void error(java.lang.Object o, java.lang.String s, java.lang.Throwable e)
public static void minor(java.lang.Class<?> c, java.lang.String s)
public static void minor(java.lang.Object o, java.lang.String s)
public static void minor(java.lang.Object o, java.lang.String s, java.lang.Throwable t)
public static void minor(java.lang.Class<?> class1, java.lang.String string, java.lang.Throwable t)
public static void normal(java.lang.Object o, java.lang.String s)
public static void normal(java.lang.Object o, java.lang.String s, java.lang.Throwable t)
public static void normal(java.lang.Class<?> c, java.lang.String s)
public static void normal(java.lang.Class<?> c, java.lang.String s, java.lang.Throwable t)
public static void warning(java.lang.Class<?> c, java.lang.String s)
public static void warning(java.lang.Class<?> c, java.lang.String s, java.lang.Throwable t)
public static void warning(java.lang.Object o, java.lang.String s)
public static void warning(java.lang.Object o, java.lang.String s, java.lang.Throwable e)
public static void logStatic(java.lang.Object o, java.lang.String s, Logger.LogLevel prio)
public static void logStatic(java.lang.Object o, java.lang.String s, java.lang.Throwable e, Logger.LogLevel prio)
@Deprecated public static void logStatic(java.lang.Object o, java.lang.String s, int prio)
public abstract void log(java.lang.Object o, java.lang.Class<?> source, java.lang.String message, java.lang.Throwable e, Logger.LogLevel priority)
o
- The object where this message was generated.source
- The class where this message was generated.message
- A clear and verbose message describing the evente
- Logs this exception with the message.priority
- The priority of the mesage, one of LogLevel.ERROR,
LogLevel.NORMAL, LogLevel.MINOR, or LogLevel.DEBUG.@Deprecated public void log(java.lang.Object o, java.lang.Class<?> source, java.lang.String message, java.lang.Throwable e, int priority)
public abstract void log(java.lang.Object source, java.lang.String message, Logger.LogLevel priority)
source
- The source object where this message was generatedmessage
- A clear and verbose message describing the eventpriority
- The priority of the mesage, one of LogLevel.ERROR,
LogLevel.NORMAL, LogLevel.MINOR, or LogLevel.DEBUG.@Deprecated public void log(java.lang.Object source, java.lang.String message, int priority)
public abstract void log(java.lang.Object o, java.lang.String message, java.lang.Throwable e, Logger.LogLevel priority)
o
- The source object where this message was generated.message
- A clear and verbose message describing the event.e
- Logs this exception with the message.priority
- The priority of the mesage, one of LogLevel.ERROR,
LogLevel.NORMAL, LogLevel.MINOR, or LogLevel.DEBUG.log(Object o, String message, int priority)
@Deprecated public void log(java.lang.Object o, java.lang.String message, java.lang.Throwable e, int priority)
public abstract void log(java.lang.Class<?> c, java.lang.String message, Logger.LogLevel priority)
c
- The class where this message was generated.message
- A clear and verbose message describing the eventpriority
- The priority of the mesage, one of LogLevel.ERROR,
LogLevel.NORMAL, LogLevel.MINOR, or LogLevel.DEBUG.@Deprecated public void log(java.lang.Class<?> c, java.lang.String message, int priority)
public abstract void log(java.lang.Class<?> c, java.lang.String message, java.lang.Throwable e, Logger.LogLevel priority)
c
- The class where this message was generated.message
- A clear and verbose message describing the evente
- Logs this exception with the message.priority
- The priority of the mesage, one of LogLevel.ERROR,
LogLevel.NORMAL, LogLevel.MINOR, or LogLevel.DEBUG.@Deprecated public void log(java.lang.Class<?> c, java.lang.String message, java.lang.Throwable e, int priority)
public abstract boolean instanceShouldLog(Logger.LogLevel priority, java.lang.Class<?> c)
@Deprecated public boolean instanceShouldLog(int priority, java.lang.Class<?> c)
public static boolean shouldLog(Logger.LogLevel priority, java.lang.Class<?> c)
@Deprecated public static boolean shouldLog(int priority, java.lang.Class<?> c)
public static boolean shouldLog(Logger.LogLevel priority, java.lang.Object o)
@Deprecated public static boolean shouldLog(int priority, java.lang.Object o)
public abstract boolean instanceShouldLog(Logger.LogLevel prio, java.lang.Object o)
@Deprecated public boolean instanceShouldLog(int prio, java.lang.Object o)
public abstract void setThreshold(Logger.LogLevel thresh)
thresh
- The new threshhold@Deprecated public void setThreshold(int thresh)
public abstract void setThreshold(java.lang.String symbolicThreshold) throws LoggerHook.InvalidThresholdException
symbolicThreshold
- The new threshhold, must be one of ERROR,NORMAL etc..LoggerHook.InvalidThresholdException
public abstract Logger.LogLevel getThresholdNew()
@Deprecated public int getThreshold()
public abstract void setDetailedThresholds(java.lang.String details) throws LoggerHook.InvalidThresholdException
public static void registerLogThresholdCallback(LogThresholdCallback ltc)
public abstract void instanceRegisterLogThresholdCallback(LogThresholdCallback ltc)
public static void unregisterLogThresholdCallback(LogThresholdCallback ltc)
public abstract void instanceUnregisterLogThresholdCallback(LogThresholdCallback ltc)
public static void registerClass(java.lang.Class<?> clazz)
public static void fatal(java.lang.Object cause, int retcode, java.lang.String message)
cause
- the object or class involvedretcode
- the return codemessage
- the reason whypublic static void globalAddHook(LoggerHook logger2)
public static void globalSetThreshold(Logger.LogLevel i)
@Deprecated public static void globalSetThreshold(int i)
public static Logger.LogLevel globalGetThresholdNew()
@Deprecated public static int globalGetThreshold()
public static void globalRemoveHook(LoggerHook hook)
public static void destroyChainIfEmpty()
public static LoggerHookChain getChain()