* Append option for logging to file 4.x-dev

Mon, 28 Jun 2021 11:42:00 +0300

author
cemkalyoncu
date
Mon, 28 Jun 2021 11:42:00 +0300
branch
4.x-dev
changeset 1696
72dc4ad1399b
parent 1695
accb75196605
child 1697
2810cd4a843e
child 1705
6e693ce168c9

* Append option for logging to file

Source/Gorgon/Utils/Logging.h file | annotate | diff | comparison | revisions
--- a/Source/Gorgon/Utils/Logging.h	Mon Jun 28 10:10:07 2021 +0300
+++ b/Source/Gorgon/Utils/Logging.h	Mon Jun 28 11:42:00 2021 +0300
@@ -153,10 +153,10 @@
 
 		/// Opens and initializer the logger using the given filename. The file
 		/// will automatically be closed when CleanUp is performed.
-		void InitializeFile(const std::string &filename) {
+		void InitializeFile(const std::string &filename, bool append = false) {
 #ifndef NO_LOGGING
 			CleanUp();
-			stream=new std::ofstream(filename);
+			stream=new std::ofstream(filename, append ? std::ios::app : std::ios::out);
 			owner=true;
 #endif
 		}

mercurial