Group :: Games/Strategy
RPM: glest
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: glest-2.0.0-logfile.patch
Download
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());