org.opengts.util
Class Print

java.lang.Object
  extended by org.opengts.util.Print

public class Print
extends java.lang.Object

Performs message logging


Nested Class Summary
static class Print.NullOutputStream
          OutputStream subclass which ignores all output.
static class Print.NullPrintStream
          PrintStream subclass which ignores all output
static class Print.RedirectStream
          Abstract class to provide log print redirection
 
Field Summary
static int LOG_ALL
           
static int LOG_DEBUG
           
static int LOG_ERROR
           
static int LOG_FATAL
           
static int LOG_INFO
           
static int LOG_OFF
           
static int LOG_UNDEFINED
           
static int LOG_WARN
           
 
Constructor Summary
Print()
           
 
Method Summary
static void _debugProbe(java.lang.String msg, java.lang.Object... args)
          Prints the specified message (with stack-frame) to stderr.
Used for temporary debug purposes, should not be included in production code.
protected static boolean _emailExceptions()
          Returns true if exceptions should be emailed to the recipient on file
static java.lang.String _getStackFrame(int frame)
          Returns a String representation of offset frame within the current stackframe.
protected static boolean _includeDate()
          Returns true if the date/time is to be included on log messages
protected static boolean _includeStackFrame()
          Returns true if the stack frame is to be included on log messages
static void _log(int level, int frame, java.lang.String msg, java.lang.Object... args)
          Logs the specified message with the specified debug level
protected static void _logStackTrace(int level, int frame, java.lang.String msg, java.lang.Throwable t)
          Logs a stack trace with the specified message to the output file
protected static void _print(java.io.PrintStream ps, int frame, boolean printFrame, java.lang.String msg, java.lang.Object... args)
          Prints the message and optional arguments to the specified PrintStream
protected static void _print(java.io.PrintStream ps, int frame, java.lang.String msg, java.lang.Object... args)
          Prints the message and optional arguments to the specified PrintStream
protected static void _println(java.io.PrintStream ps, int frame, boolean printFrame, java.lang.String msg, java.lang.Object... args)
          Prints the message and optional arguments to the specified PrintStream
protected static void _println(java.io.PrintStream ps, int frame, java.lang.String msg, java.lang.Object... args)
          Prints the message and optional arguments to the specified PrintStream
static void _println(java.io.PrintStream ps, java.lang.String msg, java.lang.Object... args)
          Prints the message and optional arguments to the specified PrintStream
static void _println(java.lang.String msg, java.lang.Object... args)
          Prints the message and optional arguments to 'stdout'.
static void _printStackTrace(java.io.PrintStream out, int frame, java.lang.String msg, java.lang.Throwable t)
          Prints a stack trace with the specified message
static void _writeLog(int level, java.lang.String logMsg)
          Writes the specified log message to the output file
protected static void closePrintStream()
          Closes the output PrintStream
static void closeRedirectedOutputStream()
          Closes the redirected output stream.
static void errPrint(java.lang.StringBuffer msg, java.lang.Object... args)
          Prints the specified message to stderr (no extra line terminator is included)
The stack-frame is ommitted.
static void errPrint(java.lang.String msg, java.lang.Object... args)
          Prints the specified message to stderr (no extra line terminator is included)
The stack-frame is ommitted.
static void errPrintln(java.lang.StringBuffer msg, java.lang.Object... args)
          Prints the specified message to stderr (includes the line-terminator '\n')
The stack-frame is ommitted.
static void errPrintln(java.lang.String msg, java.lang.Object... args)
          Prints the specified message to stderr (includes the line-terminator '\n')
The stack-frame is ommitted.
static java.lang.String formatDate(java.lang.String fmt)
          Formats the current data/time per the specified format specification
static java.lang.String getEncoding()
          Gets the character encoding for the Printed text output
static java.lang.String getHostName()
          Gets the host name for this systenm
static java.io.File getLogFile()
          Gets the output log file
static int getLogHeaderLevel()
          Gets the log header level.
static int getLogLevel()
          Gets the log level.
static java.lang.String getLogLevelString(int level)
          Gets the string name of the log level represented by the specified log level index.
static java.io.OutputStream getRedirectedOutputStream()
          Gets the instantiated redirect OutputStream
static long getRotateDeleteAgeSec()
          Gets the maximum age of rotated log files (in seconds)
static long getRotateLogFileSize()
          Gets the maximum output log file size (in bytes).
static boolean hasLogPrintStream()
          Returns true if an override log PrintStream has been defined
static boolean isDebugLoggingLevel()
          Returns true if the logging level is greater or equal to the debug level, LOG_DEBUG
static boolean isRemoteLogging()
          Returns true if RemoteLogging has been enabled
static void log(int level, java.lang.String msg)
          Logs the specified message with the specified level
static void logDebug(java.lang.String msg, java.lang.Object... args)
          Logs the specified message with a debug level
static void logError(java.lang.String msg, java.lang.Object... args)
          Logs the specified message with an error level
static void logException(java.lang.String msg, java.lang.Throwable t)
          Logs a general error with the specified message and a stack trace to the output file
static void logFatal(java.lang.String msg, java.lang.Object... args)
          Logs the specified message with a fatal level
static void logInfo(java.lang.String msg, java.lang.Object... args)
          Logs the specified message with an info level
static void logNotImplemented(java.lang.String msg)
          Logs a "Feature Not Implemented" error with the specified message and a stack trace to the output file
static void logSQLError(int frame, java.lang.String msg, java.sql.SQLException sqe)
          Logs an SQL Error with the specified messasge and a stack trace to the output file
static void logSQLError(java.sql.SQLException sqe)
          Logs an SQL Error with the specified messasge and a stack trace to the output file
static void logSQLError(java.lang.String msg, java.sql.SQLException sqe)
          Logs an SQL Error with the specified messasge and a stack trace to the output file
static void logStackTrace(java.lang.String msg)
          Logs a warning level stack trace with the specified message to the output file
static void logStackTrace(java.lang.String msg, java.lang.Throwable t)
          Logs an error level stack trace with the specified message to the output file
static void logStackTrace(java.lang.Throwable t)
          Logs an error level stack trace to the output file
static void logWarn(java.lang.String msg, java.lang.Object... args)
          Logs the specified message with a warning level
static void main(java.lang.String[] argv)
          Main entry point for testing/debugging
protected static java.io.PrintStream openPrintStream()
          Opens the output log file (does not return null)
static int parseLogLevel(java.lang.String val, int dft)
          Parses a log level integer value from a specified string integer value or log level name
static void print(java.lang.StringBuffer msg, java.lang.Object... args)
          Prints the specified message to stdout (no extra line terminator is included)
The stack-frame is ommitted.
static void print(java.lang.String msg, java.lang.Object... args)
          Prints the specified message to stdout (no extra line terminator is included)
The stack-frame is ommitted.
static void println(java.lang.StringBuffer msg, java.lang.Object... args)
          Prints the specified message to stdout (includes the line-terminator '\n')
The stack-frame is ommitted.
static void println(java.lang.String msg, java.lang.Object... args)
          Prints the specified message to stdout (includes the line-terminator '\n')
The stack-frame is ommitted.
static void resetVars()
          Resets all print logging settings.
static void setAllOutputToStdout(boolean state)
          Set all output to stderr to be sent to stdout.
static void setEncoding(java.lang.String enc)
          Sets the character encoding for the Printed text output
static int setIncludeStackFrame(int inclFrameState)
          Sets the "includeStackFrame" state.
static void setLogFile(java.io.File file)
          Sets the output log file
static void setLogHeaderLevel(int level)
          Sets the log header level.
static void setLogLevel(int level)
          Sets the log level.
static void setLogLevel(int level, boolean inclDate, boolean inclFrame)
          Sets the log level and some other log settings.
static void setLogStream(java.io.PrintStream out)
          Sets the override PrintStream used for logging
static void setRedirectedOutput(java.io.OutputStream os)
          Redirects all redirectable output to the specified OutputStream
static void setRedirectedOutput(java.io.PrintStream out)
          Redirects all redirectable output to the specified PrintStream
static boolean setRemoteLogging(java.net.InetAddress bindAddr, int port, int buffSize)
          Sets the remote log port, and starts the RemoteLogServer
static boolean setRemoteLogging(int port, int buffSize)
          Sets the remote log port, and starts the RemoteLogServer
static boolean setRemoteLogging(java.lang.String remLog)
          Sets the remote log host:port and buffer size, and starts the RemoteLogServer
static boolean setRemoteLogging(java.lang.String bindHost, int port, int buffSize)
          Sets the remote log port, and starts the RemoteLogServer
static void setRotateDeleteAgeSec(long delAgeSec)
          Sets the rotated log file delete age (in seconds)
static void setRotateLogFileSize(long maxSize)
          Sets the maximum output log file size (in bytes).
static void setSysStderr(java.io.PrintStream out)
          Sets the stderr PrintStream
static void setSysStdout(java.io.PrintStream out)
          Sets the stdout PrintStream
static void sysPrint(java.lang.StringBuffer msg, java.lang.Object... args)
          Prints the specified message to stdout (no extra line terminator is included)
The stack-frame is ommitted.
static void sysPrint(java.lang.String msg, java.lang.Object... args)
          Prints the specified message to stdout (no extra line terminator is included)
The stack-frame is ommitted.
static void sysPrintln(java.lang.StringBuffer msg, java.lang.Object... args)
          Prints the specified message to stdout (includes the line-terminator '\n')
The stack-frame is ommitted.
static void sysPrintln(java.lang.String msg, java.lang.Object... args)
          Prints the specified message to stdout (includes the line-terminator '\n')
The stack-frame is ommitted.
static void sysStackTrace(java.lang.String msg)
          Prints the specified message and current stacktrace to stdout (includes the line-terminator '\n')
The stack-frame is ommitted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_UNDEFINED

public static final int LOG_UNDEFINED
See Also:
Constant Field Values

LOG_OFF

public static final int LOG_OFF
See Also:
Constant Field Values

LOG_FATAL

public static final int LOG_FATAL
See Also:
Constant Field Values

LOG_ERROR

public static final int LOG_ERROR
See Also:
Constant Field Values

LOG_WARN

public static final int LOG_WARN
See Also:
Constant Field Values

LOG_INFO

public static final int LOG_INFO
See Also:
Constant Field Values

LOG_DEBUG

public static final int LOG_DEBUG
See Also:
Constant Field Values

LOG_ALL

public static final int LOG_ALL
See Also:
Constant Field Values
Constructor Detail

Print

public Print()
Method Detail

resetVars

public static void resetVars()
Resets all print logging settings. Does not change or reset the output streams


setIncludeStackFrame

public static int setIncludeStackFrame(int inclFrameState)
Sets the "includeStackFrame" state.

Parameters:
inclFrameState - "1" to include stackframe, "0" to omit stackframe, "-1" to set undefined (will be set based on other criteria).

_includeStackFrame

protected static boolean _includeStackFrame()
Returns true if the stack frame is to be included on log messages

Returns:
True if the stack frame is to be included on log messages

_includeDate

protected static boolean _includeDate()
Returns true if the date/time is to be included on log messages

Returns:
True if the date/time is to be included on log messages

_emailExceptions

protected static boolean _emailExceptions()
Returns true if exceptions should be emailed to the recipient on file

Returns:
True if exceptions should be emailed

getHostName

public static java.lang.String getHostName()
Gets the host name for this systenm

Returns:
The host name for this system

formatDate

public static java.lang.String formatDate(java.lang.String fmt)
Formats the current data/time per the specified format specification

Parameters:
fmt - The date/time format specification
Returns:
The formatted data/time

setEncoding

public static void setEncoding(java.lang.String enc)
Sets the character encoding for the Printed text output

Parameters:
enc - The character encoding

getEncoding

public static java.lang.String getEncoding()
Gets the character encoding for the Printed text output

Returns:
The character encoding

_getStackFrame

public static java.lang.String _getStackFrame(int frame)
Returns a String representation of offset frame within the current stackframe.

Parameters:
frame - The current frame offset
Returns:
The String representation of the requested frame

_println

public static void _println(java.lang.String msg,
                            java.lang.Object... args)
Prints the message and optional arguments to 'stdout'. (does not recognize redirection)

Parameters:
msg - The message (or message format)
args - The optional message format arguments

_println

public static void _println(java.io.PrintStream ps,
                            java.lang.String msg,
                            java.lang.Object... args)
Prints the message and optional arguments to the specified PrintStream

Parameters:
ps - The output PrintStream
msg - The message (or message format)
args - The optional message format arguments

_println

protected static void _println(java.io.PrintStream ps,
                               int frame,
                               boolean printFrame,
                               java.lang.String msg,
                               java.lang.Object... args)
Prints the message and optional arguments to the specified PrintStream

Parameters:
ps - The output PrintStream
frame - The current frame offset used to tag this message
printFrame - True to print the current stackframe
msg - The message (or message format)
args - The optional message format arguments

_println

protected static void _println(java.io.PrintStream ps,
                               int frame,
                               java.lang.String msg,
                               java.lang.Object... args)
Prints the message and optional arguments to the specified PrintStream

Parameters:
ps - The output PrintStream
frame - The current frame offset used to tag this message
msg - The message (or message format)
args - The optional message format arguments

_print

protected static void _print(java.io.PrintStream ps,
                             int frame,
                             java.lang.String msg,
                             java.lang.Object... args)
Prints the message and optional arguments to the specified PrintStream

Parameters:
ps - The output PrintStream
frame - The current frame offset used to tag this message
msg - The message (or message format)
args - The optional message format arguments

_print

protected static void _print(java.io.PrintStream ps,
                             int frame,
                             boolean printFrame,
                             java.lang.String msg,
                             java.lang.Object... args)
Prints the message and optional arguments to the specified PrintStream

Parameters:
ps - The output PrintStream
frame - The current frame offset used to tag this message
printFrame - True to print the current stackframe
msg - The message (or message format)
args - The optional message format arguments

setLogStream

public static void setLogStream(java.io.PrintStream out)
Sets the override PrintStream used for logging

Parameters:
out - The PrintStream

hasLogPrintStream

public static boolean hasLogPrintStream()
Returns true if an override log PrintStream has been defined

Returns:
True if an override log PrintStream has been defined

closeRedirectedOutputStream

public static void closeRedirectedOutputStream()
Closes the redirected output stream.


getRedirectedOutputStream

public static java.io.OutputStream getRedirectedOutputStream()
Gets the instantiated redirect OutputStream

Returns:
The instantiated redirect OutputStream (or null is undefined)

setRedirectedOutput

public static void setRedirectedOutput(java.io.OutputStream os)
Redirects all redirectable output to the specified OutputStream

Parameters:
os - The OutputStream

setRedirectedOutput

public static void setRedirectedOutput(java.io.PrintStream out)
Redirects all redirectable output to the specified PrintStream

Parameters:
out - The PrintStream

setRemoteLogging

public static boolean setRemoteLogging(java.lang.String remLog)
Sets the remote log host:port and buffer size, and starts the RemoteLogServer

Parameters:
remLog - The remote logging attributes of the form "[[HOST]:]PORT[/BUFFERSIZE]"

setRemoteLogging

public static boolean setRemoteLogging(int port,
                                       int buffSize)
Sets the remote log port, and starts the RemoteLogServer

Parameters:
port - The port on which to listen for incoming log requests
buffSize - The maximum log buffer size

setRemoteLogging

public static boolean setRemoteLogging(java.lang.String bindHost,
                                       int port,
                                       int buffSize)
Sets the remote log port, and starts the RemoteLogServer

Parameters:
bindHost - The local network interface on which the remote log server will be bound.
port - The port on which to listen for incoming log requests
buffSize - The maximum log buffer size

setRemoteLogging

public static boolean setRemoteLogging(java.net.InetAddress bindAddr,
                                       int port,
                                       int buffSize)
Sets the remote log port, and starts the RemoteLogServer

Parameters:
bindAddr - The local network interface on which the remote log server will be bound.
port - The port on which to listen for incoming log requests
buffSize - The maximum log buffer size

isRemoteLogging

public static boolean isRemoteLogging()
Returns true if RemoteLogging has been enabled

Returns:
True if RemoteLogging is enabled

setAllOutputToStdout

public static void setAllOutputToStdout(boolean state)
Set all output to stderr to be sent to stdout.

Parameters:
state - True to send stderr output to stdout

setSysStdout

public static void setSysStdout(java.io.PrintStream out)
Sets the stdout PrintStream

Parameters:
out - The PrintStream to use for stdout

setSysStderr

public static void setSysStderr(java.io.PrintStream out)
Sets the stderr PrintStream

Parameters:
out - The PrintStream to use for stderr

sysPrint

public static void sysPrint(java.lang.String msg,
                            java.lang.Object... args)
Prints the specified message to stdout (no extra line terminator is included)
The stack-frame is ommitted.

Parameters:
msg - The message to print
args - Any associated message arguments

sysPrint

public static void sysPrint(java.lang.StringBuffer msg,
                            java.lang.Object... args)
Prints the specified message to stdout (no extra line terminator is included)
The stack-frame is ommitted.

Parameters:
msg - The message to print
args - Any associated message arguments

sysPrintln

public static void sysPrintln(java.lang.String msg,
                              java.lang.Object... args)
Prints the specified message to stdout (includes the line-terminator '\n')
The stack-frame is ommitted.

Parameters:
msg - The message to print
args - Any associated message arguments

sysPrintln

public static void sysPrintln(java.lang.StringBuffer msg,
                              java.lang.Object... args)
Prints the specified message to stdout (includes the line-terminator '\n')
The stack-frame is ommitted.

Parameters:
msg - The message to print
args - Any associated message arguments

sysStackTrace

public static void sysStackTrace(java.lang.String msg)
Prints the specified message and current stacktrace to stdout (includes the line-terminator '\n')
The stack-frame is ommitted.

Parameters:
msg - The message to print

errPrint

public static void errPrint(java.lang.String msg,
                            java.lang.Object... args)
Prints the specified message to stderr (no extra line terminator is included)
The stack-frame is ommitted.

Parameters:
msg - The message to print
args - Any associated message arguments

errPrint

public static void errPrint(java.lang.StringBuffer msg,
                            java.lang.Object... args)
Prints the specified message to stderr (no extra line terminator is included)
The stack-frame is ommitted.

Parameters:
msg - The message to print
args - Any associated message arguments

errPrintln

public static void errPrintln(java.lang.String msg,
                              java.lang.Object... args)
Prints the specified message to stderr (includes the line-terminator '\n')
The stack-frame is ommitted.

Parameters:
msg - The message to print
args - Any associated message arguments

errPrintln

public static void errPrintln(java.lang.StringBuffer msg,
                              java.lang.Object... args)
Prints the specified message to stderr (includes the line-terminator '\n')
The stack-frame is ommitted.

Parameters:
msg - The message to print
args - Any associated message arguments

_debugProbe

public static void _debugProbe(java.lang.String msg,
                               java.lang.Object... args)
Prints the specified message (with stack-frame) to stderr.
Used for temporary debug purposes, should not be included in production code.

Parameters:
msg - The message to print

print

public static void print(java.lang.String msg,
                         java.lang.Object... args)
Prints the specified message to stdout (no extra line terminator is included)
The stack-frame is ommitted. (does not recognize redirection)

Parameters:
msg - The message to print
args - Any associated message arguments

print

public static void print(java.lang.StringBuffer msg,
                         java.lang.Object... args)
Prints the specified message to stdout (no extra line terminator is included)
The stack-frame is ommitted. (does not recognize redirection)

Parameters:
msg - The message to print
args - Any associated message arguments

println

public static void println(java.lang.String msg,
                           java.lang.Object... args)
Prints the specified message to stdout (includes the line-terminator '\n')
The stack-frame is ommitted. (does not recognize redirection)

Parameters:
msg - The message to print
args - Any associated message arguments

println

public static void println(java.lang.StringBuffer msg,
                           java.lang.Object... args)
Prints the specified message to stdout (includes the line-terminator '\n')
The stack-frame is ommitted. (does not recognize redirection)

Parameters:
msg - The message to print
args - Any associated message arguments

_logStackTrace

protected static void _logStackTrace(int level,
                                     int frame,
                                     java.lang.String msg,
                                     java.lang.Throwable t)
Logs a stack trace with the specified message to the output file

Parameters:
level - The log level of this trace. The log will only be printed if this value is same of greater than the current log level
frame - The current frame offset used to tag this message
msg - The message to log
t - The throwable to get the stack trace from

_printStackTrace

public static void _printStackTrace(java.io.PrintStream out,
                                    int frame,
                                    java.lang.String msg,
                                    java.lang.Throwable t)
Prints a stack trace with the specified message

Parameters:
frame - The current frame offset used to tag this message
msg - The message to print
t - The throwable to get the stack trace from

logNotImplemented

public static void logNotImplemented(java.lang.String msg)
Logs a "Feature Not Implemented" error with the specified message and a stack trace to the output file

Parameters:
msg - The message to log

logException

public static void logException(java.lang.String msg,
                                java.lang.Throwable t)
Logs a general error with the specified message and a stack trace to the output file

Parameters:
msg - The message to log
t - The throwable to get the stack trace from

logStackTrace

public static void logStackTrace(java.lang.String msg,
                                 java.lang.Throwable t)
Logs an error level stack trace with the specified message to the output file

Parameters:
msg - The message to log
t - The throwable to get the stack trace from

logStackTrace

public static void logStackTrace(java.lang.Throwable t)
Logs an error level stack trace to the output file

Parameters:
t - The throwable to get the stack trace from

logStackTrace

public static void logStackTrace(java.lang.String msg)
Logs a warning level stack trace with the specified message to the output file

Parameters:
msg - The message to log

logSQLError

public static void logSQLError(int frame,
                               java.lang.String msg,
                               java.sql.SQLException sqe)
Logs an SQL Error with the specified messasge and a stack trace to the output file

Parameters:
frame - The current frame offset used to tag this message
msg - The message to log
sqe - The SQLException to log

logSQLError

public static void logSQLError(java.sql.SQLException sqe)
Logs an SQL Error with the specified messasge and a stack trace to the output file

Parameters:
sqe - The SQLException to log

logSQLError

public static void logSQLError(java.lang.String msg,
                               java.sql.SQLException sqe)
Logs an SQL Error with the specified messasge and a stack trace to the output file

Parameters:
msg - The message to log
sqe - The SQLException to log

setLogFile

public static void setLogFile(java.io.File file)
Sets the output log file

Parameters:
file - The output log file

getLogFile

public static java.io.File getLogFile()
Gets the output log file

Returns:
The output log file

setRotateLogFileSize

public static void setRotateLogFileSize(long maxSize)
Sets the maximum output log file size (in bytes).

Parameters:
maxSize - The maximum size (in bytes)

getRotateLogFileSize

public static long getRotateLogFileSize()
Gets the maximum output log file size (in bytes).

Returns:
The maximum size (in bytes)

setRotateDeleteAgeSec

public static void setRotateDeleteAgeSec(long delAgeSec)
Sets the rotated log file delete age (in seconds)

Parameters:
delAgeSec - The rotated log file delete age (in seconds)

getRotateDeleteAgeSec

public static long getRotateDeleteAgeSec()
Gets the maximum age of rotated log files (in seconds)

Returns:
The maximum acceptable age of rotated log files (in seconds)

openPrintStream

protected static java.io.PrintStream openPrintStream()
Opens the output log file (does not return null)

Returns:
The output log file PrintStream

closePrintStream

protected static void closePrintStream()
Closes the output PrintStream


setLogLevel

public static void setLogLevel(int level,
                               boolean inclDate,
                               boolean inclFrame)
Sets the log level and some other log settings. Messages with a level lower than the set level will not be logged.

Parameters:
level - The log level
inclDate - True if the date/time should be included in the log traces
inclFrame - True if a stack frame trace should be included in log traces

setLogLevel

public static void setLogLevel(int level)
Sets the log level. Messages with a level lower than the set level will not be logged.

Parameters:
level - The log level

getLogLevel

public static int getLogLevel()
Gets the log level. Messages with a level lower than the set level will not be logged. If the value is not properly defined, the value from RTConfig will be returned.

Returns:
The log level. Traces with a level lower than this value will not be logged

isDebugLoggingLevel

public static boolean isDebugLoggingLevel()
Returns true if the logging level is greater or equal to the debug level, LOG_DEBUG

Returns:
True if the log level is greater than the debug log level

setLogHeaderLevel

public static void setLogHeaderLevel(int level)
Sets the log header level. Traces with a level equal or greater than this value will have a header.

Parameters:
level - The log header level

getLogHeaderLevel

public static int getLogHeaderLevel()
Gets the log header level. Traces with a level equal or greater than this value will have a header.

Returns:
The log header level

getLogLevelString

public static java.lang.String getLogLevelString(int level)
Gets the string name of the log level represented by the specified log level index.

Parameters:
level - The log level
Returns:
The log level string representation

parseLogLevel

public static int parseLogLevel(java.lang.String val,
                                int dft)
Parses a log level integer value from a specified string integer value or log level name

Parameters:
val - The string value to parse
dft - The default value to return if a recognized value could not be parsed
Returns:
The log level value or dft

log

public static void log(int level,
                       java.lang.String msg)
Logs the specified message with the specified level

Parameters:
level - The log level
msg - The message to log

logFatal

public static void logFatal(java.lang.String msg,
                            java.lang.Object... args)
Logs the specified message with a fatal level

Parameters:
msg - The message to log
args - Any arguments referenced by any format specifiers in msg
See Also:
String.format(java.lang.String, java.lang.Object...)

logError

public static void logError(java.lang.String msg,
                            java.lang.Object... args)
Logs the specified message with an error level

Parameters:
msg - The message to log
args - Any arguments referenced by any format specifiers in msg
See Also:
String.format(java.lang.String, java.lang.Object...)

logWarn

public static void logWarn(java.lang.String msg,
                           java.lang.Object... args)
Logs the specified message with a warning level

Parameters:
msg - The message to log
args - Any arguments referenced by any format specifiers in msg
See Also:
String.format(java.lang.String, java.lang.Object...)

logInfo

public static void logInfo(java.lang.String msg,
                           java.lang.Object... args)
Logs the specified message with an info level

Parameters:
msg - The message to log
args - Any arguments referenced by any format specifiers in msg
See Also:
String.format(java.lang.String, java.lang.Object...)

logDebug

public static void logDebug(java.lang.String msg,
                            java.lang.Object... args)
Logs the specified message with a debug level

Parameters:
msg - The message to log
args - Any arguments referenced by any format specifiers in msg
See Also:
String.format(java.lang.String, java.lang.Object...)

_log

public static void _log(int level,
                        int frame,
                        java.lang.String msg,
                        java.lang.Object... args)
Logs the specified message with the specified debug level

Parameters:
level - The log level
frame - The current frame offset used to tag this message
msg - The message to log
args - Any arguments referenced by any format specifiers in msg
See Also:
String.format(java.lang.String, java.lang.Object...)

_writeLog

public static void _writeLog(int level,
                             java.lang.String logMsg)
Writes the specified log message to the output file

Parameters:
level - The log level
logMsg - The message to write to the log

main

public static void main(java.lang.String[] argv)
Main entry point for testing/debugging

Parameters:
argv - Comand-line arguments