mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 22:26:22 +00:00
feat(Core/Logging): rework logging (#4692)
* feat(Core/Logging): rework logging * correct level for sql.sql * del unused config options * Correct build * correct after merge * whitespace 20:29:37 1. 'Player.cpp'. Replace (1) 20:29:37 2. 'ObjectMgr.cpp'. Replace (3) * 1 * correct logging * correct affter merge * 1 * 2 * LOG_LEVEL_WARN * #include "AppenderDB.h" * 3 * 4 * 5 * 1. 'WorldSocket.cpp'. Replace (1) * 6 * 1
This commit is contained in:
34
src/common/Logging/AppenderFile.h
Normal file
34
src/common/Logging/AppenderFile.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
* Copyright (C) 2008-2021 TrinityCore <http://www.trinitycore.org/>
|
||||
*/
|
||||
|
||||
#ifndef APPENDERFILE_H
|
||||
#define APPENDERFILE_H
|
||||
|
||||
#include "Appender.h"
|
||||
#include <atomic>
|
||||
|
||||
class AppenderFile : public Appender
|
||||
{
|
||||
public:
|
||||
static constexpr AppenderType type = APPENDER_FILE;
|
||||
|
||||
AppenderFile(uint8 id, std::string const& name, LogLevel level, AppenderFlags flags, std::vector<std::string_view> const& args);
|
||||
~AppenderFile();
|
||||
FILE* OpenFile(std::string const& name, std::string const& mode, bool backup);
|
||||
AppenderType getType() const override { return type; }
|
||||
|
||||
private:
|
||||
void CloseFile();
|
||||
void _write(LogMessage const* message) override;
|
||||
FILE* logfile;
|
||||
std::string _fileName;
|
||||
std::string _logDir;
|
||||
bool _dynamicName;
|
||||
bool _backup;
|
||||
uint64 _maxFileSize;
|
||||
std::atomic<uint64> _fileSize;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user