Skip to content

Commit

Permalink
fixed constructor issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yousefg-codes committed Aug 7, 2024
1 parent 9ca7946 commit 4cadccf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions UsageEnvironment/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ _Log::_Log(const string logDirectory) : logLevel(LogLevelDebug) {
SetTmpLogDir(logDirectory);
}

_Log::_Log() : logLevel(LogLevelDebug) {
SetTmpLogDir("");
}

// Caller assumed to be handling logMutex properly
FILE* _Log::AcquireFile() {
if (currLogFilePath.empty()) {
Expand All @@ -102,9 +106,7 @@ FILE* _Log::AcquireFile() {
void _Log::SetTmpLogDir(std:: string logDirectory) {
logFileDir = logDirectory;

printf("Setting tmp log directory.");
if (kMaxLogs == 0 || logDirectory.empty()) { // Use stdout
printf("Using stdout");
currLogFilePath = "";
logToStdout = true;
return;
Expand Down
3 changes: 2 additions & 1 deletion UsageEnvironment/include/Log.hh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ private:
void PrepNextLog();
void LogWithLevel(LogLevel level, const std::string filePath, int line, const char* format, va_list argptr);
public:
_Log(const std::string logDirectory = "");
_Log(const std::string logDirectory);
_Log();
~_Log() {}

void BackupLog(const std::string backupFileName);
Expand Down

0 comments on commit 4cadccf

Please sign in to comment.