All pastes #596479 Raw Edit

Something

public text v1 · immutable
#596479 ·published 2007-06-29 23:53 UTC
rendered paste body
#ifndef LOGMANAGER_H_INCLUDED
#define LOGMANAGER_H_INCLUDED

#include "UWD.h"
#include <string>
#include <iostream>
#include <fstream>

namespace UWD {
    class LogManager {
        private:
            /*! \brief LogManager constructor.*/
            LogManager(const std::string &logFile);
            ~LogManager();

            // Singleton Related
            static LogManager mLogManager;
            LogManager& operator=(LogManager&);  // Disallowed in Singleton
            LogManager(const LogManager&);       // Disallowed in Singleton
            // End Singleton Related

            std::ofstream logFileStream;
            int verbosity;

            enum {
                LOG_INFO,
                LOG_DEBUG,
            };

        public:
            static LogManager& getSingleton();
            /*!
             * \brief
             * Logs an info/status message to the log.
             *
             * Writes logMessage to the log file, no prefix.
             */
            void logInfo(std::string logMessage);
            /*!
             * \brief
             * Logs a debug message to the log.
             *
             * Writes logMessage to the log file, prefixed with (DD)
             */
            void logDebug(std::string logMessage);
            /*!
             * \brief
             * Logs an error message to the log.
             *
             * Writes logMessage to the log file, prefixed with (EE)
             */
            void logError(std::string logMessage);

    };
}



#endif // LOGMANAGER_H_INCLUDED