autohit.common
Class AutohitBasicLogManager

java.lang.Object
  extended byautohit.common.AutohitBasicLogManager

public class AutohitBasicLogManager
extends java.lang.Object

Basic autohit log manager. If anyone orders a die or lets an instance fall out of scope, it will invalidate all instances (by killing the channel). Don't do it. You should really only have one of these--ever.

This will not create a channel controller!

Version:
1.0 Version History EPG - Rewrite - 23Apr03
Author:
Erich P. Gatejen
See Also:
Controller

Constructor Summary
AutohitBasicLogManager()
          Default constructor.
AutohitBasicLogManager(AutohitLogDrain control, AutohitLogDrain client)
          Constructor.
 
Method Summary
 void addClient(Injector il, java.lang.String id)
          Add an injector to the client channel.
 void debugOff()
          Turn debug logging off
 void debugOn()
          Turn debug logging on.
 void die()
          Die
 void discardClient(java.lang.String id)
          It will discard a client injector
 void discardDrainWriter(java.lang.String id)
          Discard client drain writer.
protected  void finalize()
           
 AutohitLogDrain getClientDrain()
          Get client drain
 AutohitLogDrain getDrain()
          Get primary drain
 Injector getRootInjector()
          Get the root injector.
 AutohitLogInjectorWrapper getRootLogger()
          Get the root logger.
 void pretty(boolean p)
          Set pretty formatting on output
 void stampit(boolean p)
          Set timestamp formatting on output
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutohitBasicLogManager

public AutohitBasicLogManager()
                       throws java.lang.Exception
Default constructor. Creates a generic Drain to System.err.


AutohitBasicLogManager

public AutohitBasicLogManager(AutohitLogDrain control,
                              AutohitLogDrain client)
                       throws java.lang.Exception
Constructor. Specifies a specific drain. You should call this construcot only once ever during the life of a JVM.

Parameters:
control - A control drain
client - A client drain
Throws:
java.lang.Exception - which is usually a very bad thing.
Method Detail

getRootLogger

public AutohitLogInjectorWrapper getRootLogger()
Get the root logger.

Returns:
a reference to the root AutohitLogInjectorWrapper, which wraps the root injector
See Also:
AutohitLogInjectorWrapper

getRootInjector

public Injector getRootInjector()
Get the root injector.

Returns:
a reference to the root Injector
See Also:
AutohitLogInjectorWrapper

addClient

public void addClient(Injector il,
                      java.lang.String id)
               throws java.lang.Exception
Add an injector to the client channel. It is a very good idea to discard the logger when you are done.

Parameters:
il - An injector
id - A string id for the sender. Technically, it doesn't have to be unique.
Throws:
java.lang.Exception
See Also:
Injector

discardClient

public void discardClient(java.lang.String id)
It will discard a client injector

Parameters:
id - A string id for the sender. Needs to be the same as the one use to register it.

pretty

public void pretty(boolean p)
Set pretty formatting on output

Parameters:
p - Set TRUE for on.

stampit

public void stampit(boolean p)
Set timestamp formatting on output

Parameters:
p - Set TRUE for on.

getDrain

public AutohitLogDrain getDrain()
Get primary drain

Returns:
the primary log drain

getClientDrain

public AutohitLogDrain getClientDrain()
Get client drain

Returns:
the client log drain

discardDrainWriter

public void discardDrainWriter(java.lang.String id)
Discard client drain writer. This is a terrible hack.

Parameters:
id - the id of the drain writer to discard

debugOn

public void debugOn()
Turn debug logging on. It will turn debugging on for the root logger, but not any clients! you have to do that yourself.


debugOff

public void debugOff()
Turn debug logging off


die

public void die()
Die


finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable


Test.