com.sun.labs.minion.util
Class MinionLog

java.lang.Object
  extended by com.sun.labs.minion.util.MinionLog
All Implemented Interfaces:
com.sun.labs.util.props.Component, com.sun.labs.util.props.Configurable
Direct Known Subclasses:
Log

Deprecated.

@Deprecated
public class MinionLog
extends java.lang.Object
implements com.sun.labs.util.props.Configurable

A general purpose logging facility for the indexing and query engine. There are three kinds of messages that can be logged:

Log messages
These are logged using the log method.
Warning messages
These are logged using the warn method.
Error messages
These are logged using the error method
Debug messages
These are logged using the debug method
Each type of message can be specified on it's own stream, if required. If you specify the same stream for more than one type, it will be handled correctly.

You can also specify a logging level, and only messages whose level is lower than that level will be printed.


Field Summary
static int DEBUG
          Deprecated. Static constant for debug messages.
static int ERROR
          Deprecated. Static constant for error messages.
protected static MinionLog instance
          Deprecated. The static instance for our Singleton.
static int LOG
          Deprecated. Static constant for log messages.
protected static int[] logLevels
          Deprecated. The logging levels.
static java.lang.String PROP_LOG_FILE
          Deprecated. The property name for the log file.
protected static java.io.OutputStream[] streams
          Deprecated. The output streams.
static int WARN
          Deprecated. Static constant for warning messages.
protected static java.io.PrintWriter[] writers
          Deprecated. The PrintWriters associated with the streams.
 
Constructor Summary
MinionLog()
          Deprecated. Protected constructor for the singleton log.
 
Method Summary
static void debug(java.lang.String module, int level, java.lang.String msg)
          Deprecated. Logs a debug message.
static void debug(java.lang.String module, int level, java.lang.String msg, java.lang.Throwable t)
          Deprecated. Logs a debug message.
static void error(java.lang.String module, int level, java.lang.String msg)
          Deprecated. Logs an error message.
static void error(java.lang.String module, int level, java.lang.String msg, java.lang.Throwable t)
          Deprecated. Logs an error message.
static int getLevel(int type)
          Deprecated. Gets the log level for a given message type.
static MinionLog getLog()
          Deprecated. Gets the singleton log object.
static int getLogLevel(int type)
          Deprecated. Gets the log level for a given message type.
static void log(java.lang.String module, int level, java.lang.String msg)
          Deprecated. Logs a log message to the log stream.
static void log(java.lang.String module, int level, java.lang.String msg, java.lang.Throwable t)
          Deprecated. Logs a log message to the log stream.
 void newProperties(com.sun.labs.util.props.PropertySheet ps)
          Deprecated.  
static void setLevel(int ll)
          Deprecated. Sets the log level for all message types.
static void setLevel(int type, int ll)
          Deprecated. Sets the log level for a particular message type.
static void setLogger(java.util.logging.Logger logger)
          Deprecated.  
static void setStream(int s, java.io.OutputStream os)
          Deprecated. Sets one of the streams.
static void setStream(java.io.OutputStream os)
          Deprecated. Sets the all the logs to the same stream.
static void setStream(java.io.PrintWriter pw)
          Deprecated. Sets the all the logs to the same writer.
static void warn(java.lang.String module, int level, java.lang.String msg)
          Deprecated. Logs a warning message.
static void warn(java.lang.String module, int level, java.lang.String msg, java.lang.Throwable t)
          Deprecated. Logs a warning message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_LOG_FILE

@ConfigString(mandatory=false)
public static final java.lang.String PROP_LOG_FILE
Deprecated. 
The property name for the log file.

See Also:
Constant Field Values

instance

protected static MinionLog instance
Deprecated. 
The static instance for our Singleton.


logLevels

protected static int[] logLevels
Deprecated. 
The logging levels.


streams

protected static java.io.OutputStream[] streams
Deprecated. 
The output streams.


writers

protected static java.io.PrintWriter[] writers
Deprecated. 
The PrintWriters associated with the streams.


LOG

public static final int LOG
Deprecated. 
Static constant for log messages.

See Also:
Constant Field Values

WARN

public static final int WARN
Deprecated. 
Static constant for warning messages.

See Also:
Constant Field Values

ERROR

public static final int ERROR
Deprecated. 
Static constant for error messages.

See Also:
Constant Field Values

DEBUG

public static final int DEBUG
Deprecated. 
Static constant for debug messages.

See Also:
Constant Field Values
Constructor Detail

MinionLog

public MinionLog()
Deprecated. 
Protected constructor for the singleton log.

Method Detail

getLog

public static MinionLog getLog()
Deprecated. 
Gets the singleton log object.


getLogLevel

public static int getLogLevel(int type)
Deprecated. 
Gets the log level for a given message type.

Parameters:
type - The type of message we want the level for.
Returns:
the log level

getLevel

public static int getLevel(int type)
Deprecated. 
Gets the log level for a given message type.

Parameters:
type - The type of message we want the level for.
Returns:
the log level

setLevel

public static void setLevel(int ll)
Deprecated. 
Sets the log level for all message types.

Parameters:
ll - The logging level.

setLevel

public static void setLevel(int type,
                            int ll)
Deprecated. 
Sets the log level for a particular message type.

Parameters:
type - The type of message that we want to set the logging level for.
ll - The logging level.

setLogger

public static void setLogger(java.util.logging.Logger logger)
Deprecated. 

setStream

public static void setStream(java.io.OutputStream os)
Deprecated. 
Sets the all the logs to the same stream.

Parameters:
os - The stream that logging data will be sent to. A null value will disable all logging.

setStream

public static void setStream(java.io.PrintWriter pw)
Deprecated. 
Sets the all the logs to the same writer.

Parameters:
pw - The printwriter that logging data will be sent to. A null value will disable all logging.

setStream

public static void setStream(int s,
                             java.io.OutputStream os)
Deprecated. 
Sets one of the streams.

Parameters:
s - The stream to set.
os - The stream that logging data will be sent to. A null value will disable logging for that message type.

log

public static void log(java.lang.String module,
                       int level,
                       java.lang.String msg)
Deprecated. 
Logs a log message to the log stream.

Parameters:
module - The module that is reporting
level - The level of the current message
msg - The message to send to the log.

log

public static void log(java.lang.String module,
                       int level,
                       java.lang.String msg,
                       java.lang.Throwable t)
Deprecated. 
Logs a log message to the log stream.

Parameters:
module - The module that is reporting
level - The level of the current message
msg - The message to send to the log.
t - A throwable that we can print a stack trace for.

warn

public static void warn(java.lang.String module,
                        int level,
                        java.lang.String msg)
Deprecated. 
Logs a warning message.

Parameters:
module - The module that is reporting
level - The level of the current message
msg - The message to send to the log.

warn

public static void warn(java.lang.String module,
                        int level,
                        java.lang.String msg,
                        java.lang.Throwable t)
Deprecated. 
Logs a warning message.

Parameters:
module - The module that is reporting
level - The level of the current message
msg - The message to send to the log.
t - A throwable that we can print a stack trace for.

error

public static void error(java.lang.String module,
                         int level,
                         java.lang.String msg)
Deprecated. 
Logs an error message.

Parameters:
module - The module that is reporting
level - The level of the current message
msg - The message to send to the log.

error

public static void error(java.lang.String module,
                         int level,
                         java.lang.String msg,
                         java.lang.Throwable t)
Deprecated. 
Logs an error message.

Parameters:
module - The module that is reporting
level - The level of the current message
msg - The message to send to the log.
t - A throwable that we can print a stack trace for.

debug

public static void debug(java.lang.String module,
                         int level,
                         java.lang.String msg)
Deprecated. 
Logs a debug message.

Parameters:
module - The module that is reporting
level - The level of the current message
msg - The message to send to the log.

debug

public static void debug(java.lang.String module,
                         int level,
                         java.lang.String msg,
                         java.lang.Throwable t)
Deprecated. 
Logs a debug message.

Parameters:
module - The module that is reporting
level - The level of the current message
msg - The message to send to the log.
t - A throwable that we can print a stack trace for.

newProperties

public void newProperties(com.sun.labs.util.props.PropertySheet ps)
                   throws com.sun.labs.util.props.PropertyException
Deprecated. 
Specified by:
newProperties in interface com.sun.labs.util.props.Configurable
Throws:
com.sun.labs.util.props.PropertyException