/** \file
 *
 *  Contains the LogEngineComponent class definition.
 *
 *  Copyright (c) 2007,2008,2009 MBARI
 *  MBARI Proprietary Information.  All Rights Reserved
 *
 */

#ifndef _LOGENGINECOMPONENT_H
#define _LOGENGINECOMPONENT_H

#include "component/AsyncComponent.h"
#include "LogEngine.h"

/**
 *  Component responsible for handling the contents of the LogQueue.  Typically,
 *  logEngine is called at the end of the computation cycle, although it could
 *  be run in its own thread.
 *
 *  When run, LogEngine extracts available LogEntries from the queue,
 *  and uses a set of recipes (LoggerAssociations) to match entries
 *  to output devices (LogWriter), which may be a binary or plain-text file,
 *  the console, etc.
 *
 *  \ingroup logging
 */
class LogEngineComponent : public AsyncComponent
{

public:
    /// Constructor for Logger.
    LogEngineComponent( LogEngine* logEngine, const char *nameIn );

    /// Destructor for Logger.
    virtual ~LogEngineComponent();

    /// Run the component
    virtual void run();

private:
    LogEngine* logEngine_;

    static const Timespan PERIOD;
    static const Timespan TIMEOUT;

};

#endif // LOGENGINECOMPONENT_H
