00001 #ifndef SCTAPI_LOG_H 00002 #define SCTAPI_LOG_H 00003 00004 #include <fstream> 00005 #include <string> 00006 #include <boost/thread.hpp> 00007 #include "Sct/Addressing.h" 00008 00009 namespace SctApi { 00014 class Log : public std::ofstream { 00015 public: 00017 Log(const Sct::UCID &); 00019 Log(const Sct::UCID &, std::string fname); 00021 // Log(std::string fname, int instance); 00022 00024 ~Log(); 00025 boost::mutex & mutex() { return m_logMutex; }; 00026 private: 00027 std::string getDefaultFileName() const; 00028 void printHeader(); 00029 void printTrailer(); 00030 /* ********** Mutexes ********** */ 00031 boost::mutex m_logMutex; 00032 const Sct::UCID m_ucid; 00033 }; 00034 00035 } 00036 00037 #endif