mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Core: ported headers cleanup from master branch
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user