aboutsummaryrefslogtreecommitdiff
path: root/src/common/Logging/AppenderFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/Logging/AppenderFile.cpp')
-rw-r--r--src/common/Logging/AppenderFile.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/common/Logging/AppenderFile.cpp b/src/common/Logging/AppenderFile.cpp
index 6c68406667d..d2109936e65 100644
--- a/src/common/Logging/AppenderFile.cpp
+++ b/src/common/Logging/AppenderFile.cpp
@@ -16,17 +16,13 @@
*/
#include "AppenderFile.h"
-#include "Common.h"
-#include "StringFormat.h"
#include "Log.h"
+#include "LogMessage.h"
+#include <algorithm>
-#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
-# include <Windows.h>
-#endif
-
-AppenderFile::AppenderFile(uint8 id, std::string const& name, LogLevel level, AppenderFlags flags, ExtraAppenderArgs extraArgs) :
+AppenderFile::AppenderFile(uint8 id, std::string const& name, LogLevel level, AppenderFlags flags, std::vector<char const*> extraArgs) :
Appender(id, name, level, flags),
- logfile(NULL),
+ logfile(nullptr),
_logDir(sLog->GetLogsDir()),
_maxFileSize(0),
_fileSize(0)
@@ -101,7 +97,7 @@ FILE* AppenderFile::OpenFile(std::string const& filename, std::string const& mod
CloseFile();
std::string newName(fullName);
newName.push_back('.');
- newName.append(LogMessage::getTimeStr(time(NULL)));
+ newName.append(LogMessage::getTimeStr(time(nullptr)));
std::replace(newName.begin(), newName.end(), ':', '-');
rename(fullName.c_str(), newName.c_str()); // no error handling... if we couldn't make a backup, just ignore
}
@@ -112,7 +108,7 @@ FILE* AppenderFile::OpenFile(std::string const& filename, std::string const& mod
return ret;
}
- return NULL;
+ return nullptr;
}
void AppenderFile::CloseFile()
@@ -120,6 +116,6 @@ void AppenderFile::CloseFile()
if (logfile)
{
fclose(logfile);
- logfile = NULL;
+ logfile = nullptr;
}
}