Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Precompiled.h
- constexpr char LineEnd = '\n';
- class LogImpl {
- private:
- ofstream mFile;
- public:
- ///////////////////////////////////////////////////////////////////////////////
- LogImpl() : mFile("dwarf.log") {}
- ///////////////////////////////////////////////////////////////////////////////
- ~LogImpl() {}
- ///////////////////////////////////////////////////////////////////////////////
- template<class T>
- inline LogImpl & operator << (const T & value) {
- mFile << value;
- cout << value;
- return *this;
- }
- };
- LogImpl & Log();
- // Log.cpp
- LogImpl & Log() {
- static LogImpl log;
- return log;
- }
Advertisement
Add Comment
Please, Sign In to add comment