SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
FileLog.h
Go to the documentation of this file.
1 /**
2  * \file FileLog.h
3  * \date March 2018
4  * \authors Michael Goettlicher
5  * \copyright http://opensource.org/licenses/GPL-3.0
6  * \remarks Please use clangformat to format the code. See more code style on
7  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
8  */
9 
10 #ifndef CPLVRLAB_FILE_LOG_H
11 #define CPLVRLAB_FILE_LOG_H
12 
13 #include <string>
14 #include <fstream>
15 
16 namespace Utils
17 {
18 //-----------------------------------------------------------------------------
19 //! File logging class
20 class FileLog
21 {
22 public:
23  FileLog(std::string logDir, bool forceFlush);
24  virtual ~FileLog();
25  void flush();
26  void post(const std::string& message);
27 
28 private:
29  std::ofstream _logFile;
31 };
32 //-----------------------------------------------------------------------------
33 };
34 
35 #endif // CPLVRLAB_FILE_LOG_H
File logging class.
Definition: FileLog.h:21
bool _forceFlush
Definition: FileLog.h:30
std::ofstream _logFile
Definition: FileLog.h:29
void flush()
Definition: FileLog.cpp:43
virtual ~FileLog()
Definition: FileLog.cpp:37
void post(const std::string &message)
Definition: FileLog.cpp:48
FileLog(std::string logDir, bool forceFlush)
Definition: FileLog.cpp:20
Utils provides utilities for string & file handling, logging and math functions.
Definition: Averaged.h:22