Core: ported headers cleanup from master branch

This commit is contained in:
ariel-
2017-06-19 23:20:06 -03:00
parent 052fc24315
commit 85a7d5ce9a
1207 changed files with 21154 additions and 18404 deletions

View File

@@ -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;
}
}