FileLog.h 886 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*!
  2. @file: optimization/FileLog.h
  3. @author: Matthias Wacker
  4. */
  5. #ifndef _FILELOG_H_
  6. #define _FILELOG_H_
  7. #include <string>
  8. #include <fstream>
  9. #include "optimization/OptLogBase.h"
  10. class FileLog : public OptLogBase
  11. {
  12. public:
  13. /*!
  14. default
  15. */
  16. FileLog(){};
  17. /*!
  18. @param file string with the filename to log to
  19. */
  20. //FileLog( string file);
  21. FileLog( std::string file);
  22. /*!
  23. destructor
  24. */
  25. virtual ~FileLog();
  26. /**! Write error message to an output device (file, stdio, etc.)
  27. */
  28. virtual void writeLogError(const char* szMessage);
  29. /**! Write warning message to an output device (file, stdio, etc.)
  30. */
  31. virtual void writeLogWarning(const char* szMessage);
  32. /**! Write trace message to an output device (file, stdio, etc.)
  33. */
  34. virtual void writeLogTrace(const char* szMessage);
  35. private:
  36. std::ofstream m_stream;
  37. void toFile(const char* szMessage);
  38. };
  39. #endif