diff options
author | ariel- <ariel-@users.noreply.github.com> | 2017-06-19 23:20:06 -0300 |
---|---|---|
committer | ariel- <ariel-@users.noreply.github.com> | 2017-06-19 23:20:06 -0300 |
commit | 85a7d5ce9ac68b30da2277cc91d4b70358f1880d (patch) | |
tree | df3d2084ee2e35008903c03178039b9c986e2d08 /src/common/Logging/AppenderFile.cpp | |
parent | 052fc24315ace866ea1cf610e85df119b68100c9 (diff) |
Core: ported headers cleanup from master branch
Diffstat (limited to 'src/common/Logging/AppenderFile.cpp')
-rw-r--r-- | src/common/Logging/AppenderFile.cpp | 18 |
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; } } |