I have come to the conclusion that I need a PrimordialLogger for the ContainerManager 
system.
The PrimordialLogger is used until whatever LoggerManager is used sets up the system 
loggers.
This way I can have logging at all stages of the game, and avoid infinite loops when 
trying
to set up the LoggerManager.

The getLogger() method would be implemented in this fashion:

ContainerManager()
{
     m_primordialLogger = new PrimordialLogger();
}

Logger getLogger()
{
     if ( null != m_primordialLogger )
     {
         return m_primordialLogger;
     }

     return getLoggerManager().getDefaultLogger();
}

LoggerManager getLoggerManager()
{
     // do setup of LoggerManager
     m_primordialLogger = null;
     return m_loggerManager;
}


--------------------------------------------------------

The PrimordialLogger would be implemented like this:

public final class PrimordialLogger implements Logger
{
     public void debug( String message )
     {
         System.out.print("[DEBUG] ");
         System.out.println( message );
     }
     public void debug( String message, Throwable t )
     {
         debug( message );
         t.printStackTrace( System.out );
     }
     public boolean isDebugEnabled()
     {
         return true;
     }
}

-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to