Skip to content

Commit

Permalink
logging for server under different name
Browse files Browse the repository at this point in the history
git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@2988 8aca7d54-2c30-db11-9de9-000461428c89
  • Loading branch information
prissi committed Jan 1, 2010
1 parent b6841d8 commit eb4c43f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions simmain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,13 @@ int simu_main(int argc, char** argv)

if (gimme_arg(argc, argv, "-log", 0)) {
chdir( umgebung_t::user_dir );
init_logging("simu.log", true, gimme_arg(argc, argv, "-log", 0) != NULL);
const char *logname = "simu.log";
if( gimme_arg(argc, argv, "-server", 0) ) {
logname = "simu-server.log";
}
init_logging( logname, true, gimme_arg(argc, argv, "-log", 0) != NULL);
} else if (gimme_arg(argc, argv, "-debug", 0) != NULL) {
init_logging("stderr", true, gimme_arg(argc, argv, "-debug", 0) != NULL);
init_logging( "stderr", true, gimme_arg(argc, argv, "-debug", 0) != NULL);
} else {
init_logging(NULL, false, false);
}
Expand Down
2 changes: 1 addition & 1 deletion utils/log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ log_t::log_t(const char *logfilename, bool force_flush, bool log_debug)
this->log_debug = log_debug;

if(logfilename == NULL) {
log=NULL; /* kein log */
log = NULL; /* kein log */
tee = NULL;
} else if(strcmp(logfilename,"stdio") == 0) {
log = stdout;
Expand Down

0 comments on commit eb4c43f

Please sign in to comment.