mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-05 11:26:35 +00:00
[Logging] Table Injection - Member Variable Cleanup (#2281)
* Logsys member variable cleanup, table injection * Private member adjustments, OOB checks * continue
This commit is contained in:
+12
-13
@@ -317,26 +317,20 @@ public:
|
||||
std::string webhook_url;
|
||||
};
|
||||
|
||||
DiscordWebhooks discord_webhooks[MAX_DISCORD_WEBHOOK_ID]{};
|
||||
|
||||
bool file_logs_enabled = false;
|
||||
|
||||
int log_platform = 0;
|
||||
std::string platform_file_name;
|
||||
|
||||
const DiscordWebhooks *GetDiscordWebhooks() const;
|
||||
|
||||
// gmsay
|
||||
uint16 GetGMSayColorFromCategory(uint16 log_category);
|
||||
|
||||
EQEmuLogSys *SetGMSayHandler(std::function<void(uint16 log_type, const std::string &)> f)
|
||||
{
|
||||
on_log_gmsay_hook = f;
|
||||
m_on_log_gmsay_hook = f;
|
||||
return this;
|
||||
}
|
||||
|
||||
EQEmuLogSys *SetDiscordHandler(std::function<void(uint16 log_category, int webhook_id, const std::string &)> f)
|
||||
{
|
||||
on_log_discord_hook = f;
|
||||
m_on_log_discord_hook = f;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -346,7 +340,7 @@ public:
|
||||
uint16 log_type,
|
||||
const std::string &
|
||||
)> f
|
||||
) { on_log_console_hook = f; }
|
||||
) { m_on_log_console_hook = f; }
|
||||
void SilenceConsoleLogging();
|
||||
void EnableConsoleLogging();
|
||||
|
||||
@@ -357,9 +351,13 @@ private:
|
||||
|
||||
// reference to database
|
||||
Database *m_database;
|
||||
std::function<void(uint16 log_category, const std::string &)> on_log_gmsay_hook;
|
||||
std::function<void(uint16 log_category, int webhook_id, const std::string &)> on_log_discord_hook;
|
||||
std::function<void(uint16 log_category, const std::string &)> on_log_console_hook;
|
||||
std::function<void(uint16 log_category, const std::string &)> m_on_log_gmsay_hook;
|
||||
std::function<void(uint16 log_category, int webhook_id, const std::string &)> m_on_log_discord_hook;
|
||||
std::function<void(uint16 log_category, const std::string &)> m_on_log_console_hook;
|
||||
DiscordWebhooks m_discord_webhooks[MAX_DISCORD_WEBHOOK_ID]{};
|
||||
bool m_file_logs_enabled = false;
|
||||
int m_log_platform = 0;
|
||||
std::string m_platform_file_name;
|
||||
|
||||
std::string FormatOutMessageString(uint16 log_category, const std::string &in_message);
|
||||
std::string GetLinuxConsoleColorFromCategory(uint16 log_category);
|
||||
@@ -368,6 +366,7 @@ private:
|
||||
void ProcessConsoleMessage(uint16 log_category, const std::string &message);
|
||||
void ProcessLogWrite(uint16 log_category, const std::string &message);
|
||||
bool IsRfc5424LogCategory(uint16 log_category);
|
||||
void InjectTablesIfNotExist();
|
||||
};
|
||||
|
||||
extern EQEmuLogSys LogSys;
|
||||
|
||||
Reference in New Issue
Block a user