org.inxar.hotswap
Class ConsoleLog

java.lang.Object
  |
  +--org.inxar.hotswap.ConsoleLog
All Implemented Interfaces:
ProxyLog

public class ConsoleLog
extends Object
implements ProxyLog

Concrete implementation of ProxyLog that writes to the console (or any Writer, to be precise). The logging priorities can be set by OR'ing the PRI_XXX constants and passing it to the appropriate constructor. The user should also call close() at the end of the session.

Since:
0.8.6

Inner classes inherited from class org.inxar.hotswap.ProxyLog
ProxyLog.Channel
 
Field Summary
static int PRI_DEBUG
          Logging priority constant.
static int PRI_FATAL
          Logging priority constant.
static int PRI_INFO
          Logging priority constant.
static int PRI_WARN
          Logging priority constant.
 
Constructor Summary
ConsoleLog()
          Constructs a ConsoleLog that writes to System.out with all priorities enabled.
ConsoleLog(int priorities)
          Constructs a ConsoleLog that writes to System.out with the given priorities enabled.
ConsoleLog(int priorities, Writer out)
          Constructs a ConsoleLog that writes to the given Writer with the given priorities enabled.
ConsoleLog(Writer out)
          Constructs a ConsoleLog that writes to the given Writer with all priorites enabled.
 
Method Summary
 void addPriority(int priority)
          OR's the given priority level to the current set of activated log priority levels.
 void close()
          Closes the Stream was well as printing a summary of the channels that were involved in the logging session.
 boolean initialize(Properties p)
          This is used within ProxyClassLoader.initProxyLog
 ProxyLog.Channel newChannel(String name, Object obj)
          Creates a new logging channel for the given Object under the given "common" label.
 void removePriority(int priority)
          AND NOT's the given priority level from the current set of activated log priority levels.
 void setPriority(int priorities)
          Sets the given priority levels.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PRI_DEBUG

public static final int PRI_DEBUG
Logging priority constant.

PRI_INFO

public static final int PRI_INFO
Logging priority constant.

PRI_WARN

public static final int PRI_WARN
Logging priority constant.

PRI_FATAL

public static final int PRI_FATAL
Logging priority constant.
Constructor Detail

ConsoleLog

public ConsoleLog()
Constructs a ConsoleLog that writes to System.out with all priorities enabled.

ConsoleLog

public ConsoleLog(Writer out)
Constructs a ConsoleLog that writes to the given Writer with all priorites enabled.

ConsoleLog

public ConsoleLog(int priorities)
Constructs a ConsoleLog that writes to System.out with the given priorities enabled.

ConsoleLog

public ConsoleLog(int priorities,
                  Writer out)
Constructs a ConsoleLog that writes to the given Writer with the given priorities enabled.
Method Detail

toString

public String toString()
Overrides:
toString in class Object

newChannel

public ProxyLog.Channel newChannel(String name,
                                   Object obj)
Description copied from interface: ProxyLog
Creates a new logging channel for the given Object under the given "common" label.
Specified by:
newChannel in interface ProxyLog

initialize

public boolean initialize(Properties p)
This is used within ProxyClassLoader.initProxyLog
Specified by:
initialize in interface ProxyLog

addPriority

public void addPriority(int priority)
OR's the given priority level to the current set of activated log priority levels.

removePriority

public void removePriority(int priority)
AND NOT's the given priority level from the current set of activated log priority levels.

setPriority

public void setPriority(int priorities)
Sets the given priority levels.

close

public void close()
Closes the Stream was well as printing a summary of the channels that were involved in the logging session.