diff --git a/include/Log.hpp b/include/Log.hpp index 3d18652..7c3ba22 100644 --- a/include/Log.hpp +++ b/include/Log.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Log.hpp,v 1.2 2005/02/16 06:58:05 cozman Exp $ +// $Id: Log.hpp,v 1.3 2005/02/27 05:53:01 cozman Exp $ #ifndef PHOTON_LOG_HPP #define PHOTON_LOG_HPP @@ -14,6 +14,7 @@ #include #include +#include "util/Singleton.hpp" #include "LogSink.hpp" namespace photon @@ -22,13 +23,8 @@ namespace photon // Class: Log // Log class for photon, Log passes all messages to any attached , // which can then take care of any output which is desired. -class Log +class Log : public util::Singleton { - -public: - Log(); - ~Log(); - // Group: Sink Maintenance public: @@ -110,15 +106,15 @@ private: std::stringstream buffer_; LogLevel lastLevel_; std::list sinks_; - - //assignment left undefined - Log(const Log &rhs); - Log& operator=(const Log &rhs); + + // singleton stuff +private: + friend class util::Singleton; + friend class std::auto_ptr; + Log(); + ~Log(); }; -//Define a log to be used throughout photon -extern Log log; - } #endif //PHOTON_LOG_HPP diff --git a/src/Log.cpp b/src/Log.cpp index 76894b8..13e6c72 100644 --- a/src/Log.cpp +++ b/src/Log.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Log.cpp,v 1.5 2005/02/16 06:58:26 cozman Exp $ +// $Id: Log.cpp,v 1.6 2005/02/27 05:53:01 cozman Exp $ #include "Log.hpp" @@ -128,6 +128,4 @@ std::ostream& Log::critical() return buffer_; } -Log log; - }