Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37400778
en ru br
ALT Linux repos
4.0: 2.0.0-alt3

Group :: Games/Strategy
RPM: glest

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: glest-2.0.0-logfile.patch
Download


--- glest_source_2.0.0/source/glest_game/main/program.cpp.orig	2006-12-01 20:47:26 +0300
+++ glest_source_2.0.0/source/glest_game/main/program.cpp	2006-12-01 20:49:12 +0300
@@ -66,7 +66,10 @@
 
     //log start
 	Logger &logger= Logger::getInstance();
-	logger.setFile("glest.log");
+	string home = getenv("HOME");
+	string logfile = home + "/.glest.log";
+	printf("Logfile patch debug: using %s as logfile\n", logfile.c_str());
+	logger.setFile(logfile.c_str());
 	logger.clear();
     
 	srand(time(NULL));
--- glest_source_2.0.0/source/glest_game/facilities/logger.cpp.orig	2006-12-01 20:47:11 +0300
+++ glest_source_2.0.0/source/glest_game/facilities/logger.cpp	2006-12-01 20:50:07 +0300
@@ -48,7 +48,7 @@
 void Logger::add(const string &str,  bool renderScreen){
 	FILE *f=fopen(fileName.c_str(), "at+");
 	if(f==NULL){
-		throw runtime_error("Error opening log file"+ fileName);
+		throw runtime_error("Error opening log file: "+ fileName);
 	}
 	fprintf(f, "%s\n", str.c_str());
     fclose(f);
@@ -79,7 +79,7 @@
 
 	FILE *f= fopen(fileName.c_str(), "wt+");
 	if(f==NULL){
-		throw runtime_error("Error opening log file"+ fileName);
+		throw runtime_error("Error opening log file: "+ fileName);
 	}
     
     fprintf(f, "%s", s.c_str());
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin