Skip to content

Commit

Permalink
Make log files optional
Browse files Browse the repository at this point in the history
  • Loading branch information
lightvector committed Jun 4, 2020
1 parent 4a79cde commit 6519e26
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cpp/command/analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int MainCmds::analysis(int argc, const char* const* argv) {
throw StringError("Cannot specify both logFile and logDir in config");
else if(cfg.contains("logFile"))
logger.addFile(cfg.getString("logFile"));
else {
else if(cfg.contains("logDir")) {
MakeDir::make(cfg.getString("logDir"));
Rand rand;
logger.addFile(cfg.getString("logDir") + "/" + DateTime::getCompactDateTimeString() + "-" + Global::uint32ToHexString(rand.nextUInt()) + ".log");
Expand Down
2 changes: 1 addition & 1 deletion cpp/command/gtp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ int MainCmds::gtp(int argc, const char* const* argv) {
throw StringError("Cannot specify both logFile and logDir in config");
else if(cfg.contains("logFile"))
logger.addFile(cfg.getString("logFile"));
else {
else if(cfg.contains("logDir")) {
MakeDir::make(cfg.getString("logDir"));
Rand rand;
logger.addFile(cfg.getString("logDir") + "/" + DateTime::getCompactDateTimeString() + "-" + Global::uint32ToHexString(rand.nextUInt()) + ".log");
Expand Down
2 changes: 1 addition & 1 deletion cpp/command/match.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int MainCmds::match(int argc, const char* const* argv) {
KataGoCommandLine cmd("Play different nets against each other with different search settings in a match or tournament.");
cmd.addConfigFileArg("","match_example.cfg");

TCLAP::ValueArg<string> logFileArg("","log-file","Log file to output to",true,string(),"FILE");
TCLAP::ValueArg<string> logFileArg("","log-file","Log file to output to",false,string(),"FILE");
TCLAP::ValueArg<string> sgfOutputDirArg("","sgf-output-dir","Dir to output sgf files",false,string(),"DIR");

cmd.add(logFileArg);
Expand Down
2 changes: 1 addition & 1 deletion cpp/command/matchauto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ int MainCmds::matchauto(int argc, const char* const* argv) {
KataGoCommandLine cmd("Play different nets against each other with different search settings in a match or tournament, experimental.");
cmd.addConfigFileArg("","");

TCLAP::ValueArg<string> logFileArg("","log-file","Log file to output to",true,string(),"FILE");
TCLAP::ValueArg<string> logFileArg("","log-file","Log file to output to",false,string(),"FILE");
TCLAP::ValueArg<string> sgfOutputDirArg("","sgf-output-dir","Dir to output sgf files",false,string(),"DIR");
TCLAP::ValueArg<string> resultsDirArg("","results-dir","Dir to read/write win loss result files",true,string(),"DIR");
cmd.add(logFileArg);
Expand Down
2 changes: 1 addition & 1 deletion cpp/command/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ int MainCmds::demoplay(int argc, const char* const* argv) {
cmd.addConfigFileArg("","");
cmd.addModelFileArg();

TCLAP::ValueArg<string> logFileArg("","log-file","Log file to output to",true,string(),"FILE");
TCLAP::ValueArg<string> logFileArg("","log-file","Log file to output to",false,string(),"FILE");
cmd.add(logFileArg);
cmd.parse(argc,argv);

Expand Down

0 comments on commit 6519e26

Please sign in to comment.