Changeset 9550 for code/trunk/src/libraries/util/output/LogWriter.h
- Timestamp:
- Mar 12, 2013, 11:13:03 PM (11 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/testing (added) merged: 9015,9017,9020-9022,9025-9026,9047,9076-9078,9114-9115,9221-9226,9356,9473-9480,9524,9529-9531,9533-9545,9547-9549
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/util/output/LogWriter.h
r8858 r9550 47 47 @brief The LogWriter class inherits from BaseWriter and writes output to a log-file. 48 48 49 It is implemented as singleton because we (currently) use only one 50 log-file. The path of the file can be changed, in which case the file 49 The path of the file can be changed, in which case the file 51 50 is rewritten by using the output stored by MemoryWriter. This adds the 52 51 possibility to change the desired output levels before changing the … … 57 56 { 58 57 public: 59 static LogWriter& getInstance(); 58 LogWriter(); 59 LogWriter(const LogWriter&); 60 virtual ~LogWriter(); 60 61 61 void setLogPath(const std::string& path); 62 void setLogDirectory(const std::string& directory); 63 64 /** @brief Returns the path to the logfile. */ 65 inline std::string getPath() const 66 { return this->directory_ + '/' + this->filename_; } 67 /** @brief Returns the open file stream. */ 68 inline const std::ofstream& getFile() const 69 { return this->file_; } 62 70 63 71 protected: … … 65 73 66 74 private: 67 LogWriter();68 LogWriter(const LogWriter&);69 virtual ~LogWriter();70 71 75 void openFile(); 72 76 void closeFile(); 73 77 74 std::string filename_; ///< The name of the log-file (without directories) 75 std::string path_; ///< The path of the log-file (without file-name) 76 bool bDefaultPath_; ///< If true, the log-file resides at the default path (which is usually a temporary directory) 78 void archive(int index = 0); 79 std::string getArchivedPath(int index) const; 77 80 81 std::string filename_; ///< The name of the log-file (without directory) 82 std::string directory_; ///< The directory where the log-file resided (without file-name) 78 83 std::ofstream file_; ///< The output file stream. 79 84 };
Note: See TracChangeset
for help on using the changeset viewer.