| java.lang.Object uk.org.ponder.util.Logger
Logger | public class Logger (Code) | | A useful logging class that
- Compactly annotates the output from different threads
- Supports multiple levels of logging message priority, held in a stack
- Renders unprintable Unicode characters in a detectable form
- Can redirect output to console or to file
Coming soon:
Some form of timestamping.
|
Method Summary | |
public static boolean | passDebugLevel(int debuglevel) Allows clients to detect whether a given debugging priority level passes the current
threshold.
Parameters: debuglevel - The debug level to be checked. | public static void | popDebugLevel() Pops the last debugging level that was pushed onto the stack, and sets the
current debugging level to the new stack top level. | public static void | print(String toprint, int debuglevel) Prints a message with a particular priority level, without a newline.
Parameters: toprint - The message to be printed. Parameters: debuglevel - The priority level of the message. | public static void | print(Object toprint) Prints the supplied object to the debug stream. | public static void | print(String toprint) Prints the supplied message to the debug stream. | public static void | printStackTrace(Throwable t) Prints a stack trace for the supplied exception to the debug stream, with the
default priority level of DEBUG_SEVERE . | public static void | printStackTrace(Throwable t, int debuglevel) Prints a stack trace for the supplied exception to the debug stream, with the
specified priority level. | public static void | println(String toprint, int debuglevel) Prints a message with a particular priority level, followed by a newline.
Parameters: toprint - The message to be printed. Parameters: debuglevel - The priority level of the message. | public static void | println(Object toprint) Prints the supplied object to the debug stream followed by a newline. | public static void | println(String toprint) Prints the supplied message to the debug stream, followed by a newline. | public static void | pushDebugLevel(int debuglevel) Pushes the specified debugging level onto the stack, and sets the current debugging
level to this level. | public static void | setConsoleOutput() Sets the destination for debugging messages to the console. | public static void | setDebugLevel(int debuglevel) Sets the current debugging level to the specified level. | public static void | setDestinationFile(String filename) Sets the destination for debugging messages to a file with the specified name. |
DEBUG_ASSERTION | final public static int DEBUG_ASSERTION(Code) | | |
DEBUG_ENTIRELY_CRITICAL | final public static int DEBUG_ENTIRELY_CRITICAL(Code) | | |
DEBUG_EXTRA_INFO | final public static int DEBUG_EXTRA_INFO(Code) | | |
DEBUG_INFORMATIONAL | final public static int DEBUG_INFORMATIONAL(Code) | | |
DEBUG_LEVEL | public static int DEBUG_LEVEL(Code) | | |
DEBUG_PAINTING | final public static int DEBUG_PAINTING(Code) | | |
DEBUG_QUITE_INTERESTING | final public static int DEBUG_QUITE_INTERESTING(Code) | | |
DEBUG_SEVERE | final public static int DEBUG_SEVERE(Code) | | |
DEBUG_SUBATOMIC | final public static int DEBUG_SUBATOMIC(Code) | | |
DEBUG_WARNING | final public static int DEBUG_WARNING(Code) | | |
debugmode | final public static boolean debugmode(Code) | | |
log | public static org.apache.log4j.Logger log(Code) | | |
passDebugLevel | public static boolean passDebugLevel(int debuglevel)(Code) | | Allows clients to detect whether a given debugging priority level passes the current
threshold.
Parameters: debuglevel - The debug level to be checked. true if a message of the specified priority level would beprinted. |
popDebugLevel | public static void popDebugLevel()(Code) | | Pops the last debugging level that was pushed onto the stack, and sets the
current debugging level to the new stack top level.
|
print | public static void print(String toprint, int debuglevel)(Code) | | Prints a message with a particular priority level, without a newline.
Parameters: toprint - The message to be printed. Parameters: debuglevel - The priority level of the message. If the current prioritylevel is higher than the supplied level, printing of the message will be suppressed. |
print | public static void print(Object toprint)(Code) | | Prints the supplied object to the debug stream.
Parameters: toprint - The object to be printed. |
print | public static void print(String toprint)(Code) | | Prints the supplied message to the debug stream.
Parameters: The - message to be printed. |
printStackTrace | public static void printStackTrace(Throwable t)(Code) | | Prints a stack trace for the supplied exception to the debug stream, with the
default priority level of DEBUG_SEVERE .
Parameters: t - The throwable for which a stack trace is required. |
printStackTrace | public static void printStackTrace(Throwable t, int debuglevel)(Code) | | Prints a stack trace for the supplied exception to the debug stream, with the
specified priority level.
Parameters: t - The throwable for which a stack trace is required. Parameters: debuglevel - The priority level for the stack trace. |
println | public static void println(String toprint, int debuglevel)(Code) | | Prints a message with a particular priority level, followed by a newline.
Parameters: toprint - The message to be printed. Parameters: debuglevel - The priority level of the message. If the current priority levelis higher than the supplied level, printing of the message will be suppressed.If the current debug level is DEBUG_ASSERTION , a message of withpriority DEBUG_ASSERTION will trigger an AssertionException. |
println | public static void println(Object toprint)(Code) | | Prints the supplied object to the debug stream followed by a newline.
Parameters: toprint - The object to be printed. |
println | public static void println(String toprint)(Code) | | Prints the supplied message to the debug stream, followed by a newline.
Parameters: The - message to be printed. |
pushDebugLevel | public static void pushDebugLevel(int debuglevel)(Code) | | Pushes the specified debugging level onto the stack, and sets the current debugging
level to this level.
Parameters: debuglevel - The new debugging level. |
setConsoleOutput | public static void setConsoleOutput()(Code) | | Sets the destination for debugging messages to the console.
|
setDebugLevel | public static void setDebugLevel(int debuglevel)(Code) | | Sets the current debugging level to the specified level. Messages with priorities
lower than this level (i.e. with higher integer values) will be suppressed.
Parameters: debuglevel - The new debugging level to operate at. |
setDestinationFile | public static void setDestinationFile(String filename)(Code) | | Sets the destination for debugging messages to a file with the specified name.
If this file cannot be opened, output will revert to the console.
If null is supplied for the filename, the filename defaults to
javalog.txt
Parameters: filename - The filename to receive logging output. |
|
|