Hi.
I am developing on linux a plugin for an application. And i want to use a simple but powerfull loger.
So i am using this:
// ==================================
//! A log class.
/*!
With this nice util dxr3plugin generates and mange a log file. In this
file the developer/enduser can find informations and can find errors,
problems and ohter stuff.
*/
class cLog : public Singleton
{
public:
cLog(); // use default log file
cLog(std::string FileName);
~cLog() { Close(); }
void SetForceFlush(const bool v) { m_ForeFlush = v; }
bool GetForceFlush() const { return m_ForeFlush; }
// nice operator overloading
template cLog &operator<<(const T& output)
{
m_LogStream << output;
if (m_ForeFlush) m_LogStream.flush();
return *this;
}
private:
std::ofstream m_LogStream;
bool m_LogOpen;
bool m_ForeFlush;
void Open(std::string Filename); // with this function we open our logfile
void Close(); // with this function we close our logfile
};
No i call the loger so:
cLog::Instance() << (char*)"This is a test";
And i get this error:
In file included from dxr3interface.c:77:
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3/bits/ios_base.h: In
copy constructor `std::basic_ios
>::basic_ios(const std::basic_ios >&)'':
dxr3singleton.h:18: instantiated from `static T Singleton::Instance() [with T = cLog]''
dxr3log.h:28: instantiated from `cLog& cLog::operator<<(const T&) [with T = char*]''
dxr3interface.c:77: instantiated from here
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3/bits/ios_base.h:668: error: `
std::ios_base::ios_base(const std::ios_base&)'' is private
dxr3singleton.h:18: error: within this context
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3/streambuf: In copy
constructor `std::basic_filebuf
>::basic_filebuf(const std::basic_filebuf >&)'':
dxr3singleton.h:18: instantiated from `static T Singleton::Instance() [with T = cLog]''
dxr3log.h:28: instantiated from `cLog& cLog::operator<<(const T&) [with T = char*]''
dxr3interface.c:77: instantiated from here
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3/streambuf:922: error: `
std::basic_streambuf<_CharT, _Traits>::basic_streambuf(const
std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char, _Traits =
std::char_traits]'' is private
What could be wrong?
Thanks, for any help,
Christian