Save server logs to logs/ instead of config/
This commit is contained in:
		
							parent
							
								
									428053934a
								
							
						
					
					
						commit
						6511e13585
					
				| @ -88,10 +88,14 @@ void Logger::addEntry(QString entry) | |||||||
| 
 | 
 | ||||||
| void Logger::flush() | void Logger::flush() | ||||||
| { | { | ||||||
|  |     QDir dir("logs/"); | ||||||
|  |     if (!dir.exists()) { | ||||||
|  |         dir.mkpath("."); | ||||||
|  |     } | ||||||
|     // raiden suggested this, but idk if i want to use it
 |     // raiden suggested this, but idk if i want to use it
 | ||||||
|     // QString time = QDateTime::currentDateTime().toString("ddd mm/dd/yy hh:mm:ss");
 |     // QString time = QDateTime::currentDateTime().toString("ddd mm/dd/yy hh:mm:ss");
 | ||||||
|     // QString filename = QStringLiteral("reports/%1/%2.log").arg(area->name).arg(time);
 |     // QString filename = QStringLiteral("reports/%1/%2.log").arg(area->name).arg(time);
 | ||||||
|     QFile logfile("config/server.log"); |     QFile logfile("logs/server.log"); | ||||||
|     if (logfile.open(QIODevice::WriteOnly | QIODevice::Append)) { |     if (logfile.open(QIODevice::WriteOnly | QIODevice::Append)) { | ||||||
|         QTextStream file_stream(&logfile); |         QTextStream file_stream(&logfile); | ||||||
|         while (!buffer.isEmpty()) |         while (!buffer.isEmpty()) | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 MangosArentLiterature
						MangosArentLiterature