Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 28, 2009, 11:18:20 AM (15 years ago)
Author:
rgrieder
Message:

Resolved a bug causing the static initialisation of the OutputHandler to go nuts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/libraries/util/OutputHandler.cc

    r5994 r6000  
    6363    {
    6464    public:
    65         //! Gets temporary log path and starts the log file
    66         LogFileWriter()
     65        /**
     66        @brief
     67            Gets temporary log path and starts the log file
     68        @param outputHandler
     69            This is only required to avoid another call to getInstance (this c'tor was
     70            called from getInstance!)
     71        */
     72        LogFileWriter(OutputHandler& outputHandler)
    6773            : OutputListener(OutputHandler::logFileOutputListenerName_s)
    6874        {
     
    8793            this->outputStream_ = &this->logFile_;
    8894            // Use default level until we get the configValue from the Core
    89             OutputHandler::getInstance().setSoftDebugLevel(this->getOutputListenerName(), OutputLevel::Debug);
    90             OutputHandler::getInstance().registerOutputListener(this);
     95            outputHandler.setSoftDebugLevel(this->getOutputListenerName(), OutputLevel::Debug);
     96            outputHandler.registerOutputListener(this);
    9197        }
    9298
     
    134140        friend class OutputHandler;
    135141
    136         //! Sets the right soft debug level and registers itself
    137         MemoryLogWriter()
     142        /**
     143        @brief
     144            Sets the right soft debug level and registers itself
     145        @param outputHandler
     146            This is only required to avoid another call to getInstance (this c'tor was
     147            called from getInstance!)
     148        */
     149        MemoryLogWriter(OutputHandler& outputHandler)
    138150            : OutputListener("memoryLog")
    139151        {
    140152            this->outputStream_ = &this->buffer_;
    141153            // We capture as much input as the listener with the highest level
    142             OutputHandler::getInstance().setSoftDebugLevel(this->getOutputListenerName(), OutputHandler::getSoftDebugLevel());
    143             OutputHandler::getInstance().registerOutputListener(this);
     154            outputHandler.setSoftDebugLevel(this->getOutputListenerName(), OutputHandler::getSoftDebugLevel());
     155            outputHandler.registerOutputListener(this);
    144156        }
    145157
     
    170182        : outputLevel_(OutputLevel::Verbose)
    171183    {
    172         this->logFile_ = new LogFileWriter();
    173         this->output_  = new MemoryLogWriter();
     184        this->logFile_ = new LogFileWriter(*this);
     185        this->output_  = new MemoryLogWriter(*this);
    174186    }
    175187
Note: See TracChangeset for help on using the changeset viewer.