Skip to content

Commit

Permalink
Readded debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
yousefg-codes committed Aug 7, 2024
1 parent 448bf46 commit 9c47f62
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions UsageEnvironment/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,22 @@ FILE* _Log::AcquireFile() {
return stderr;
}
} else {
printf("The log file path: %s\n", currLogFilePath.c_str());
FILE* logFileHandle = fopen(currLogFilePath.c_str(), "a");
if (logFileHandle == NULL) {
fprintf(stderr, "Couldn't acquire log number %u.%s\n", logFileNum, strerror(errno));
}
return logFileHandle;
}
fflush(stdout);
}

void _Log::SetTmpLogDir(std::string logDirectory) {
logFileDir = logDirectory;

printf("Setting tmp log dir.\n");
if (kMaxLogs == 0 || logDirectory.empty()) { // Use stdout
printf("We are using stdout.\n");
currLogFilePath = "";
logToStdout = true;
return;
Expand All @@ -116,6 +120,7 @@ void _Log::SetTmpLogDir(std::string logDirectory) {
// Set log file to 0 again
SetLogFileNum(0);
logToStdout = false;
fflush(stdout);
}

void _Log::SetLogFileNum(unsigned int logNum) {
Expand Down

0 comments on commit 9c47f62

Please sign in to comment.