mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
[Logging] Auto Update Log Category Names (#4890)
This commit is contained in:
parent
fb49ce2404
commit
ec31fddbae
@ -682,14 +682,33 @@ EQEmuLogSys *EQEmuLogSys::LoadLogDatabaseSettings(bool silent_load)
|
|||||||
if (is_missing_in_database && !is_deprecated_category) {
|
if (is_missing_in_database && !is_deprecated_category) {
|
||||||
LogInfo("Automatically adding new log category [{}] ({})", Logs::LogCategoryName[i], i);
|
LogInfo("Automatically adding new log category [{}] ({})", Logs::LogCategoryName[i], i);
|
||||||
|
|
||||||
auto new_category = LogsysCategoriesRepository::NewEntity();
|
auto e = LogsysCategoriesRepository::NewEntity();
|
||||||
new_category.log_category_id = i;
|
e.log_category_id = i;
|
||||||
new_category.log_category_description = Strings::Escape(Logs::LogCategoryName[i]);
|
e.log_category_description = Strings::Escape(Logs::LogCategoryName[i]);
|
||||||
new_category.log_to_console = log_settings[i].log_to_console;
|
e.log_to_console = log_settings[i].log_to_console;
|
||||||
new_category.log_to_gmsay = log_settings[i].log_to_gmsay;
|
e.log_to_gmsay = log_settings[i].log_to_gmsay;
|
||||||
new_category.log_to_file = log_settings[i].log_to_file;
|
e.log_to_file = log_settings[i].log_to_file;
|
||||||
new_category.log_to_discord = log_settings[i].log_to_discord;
|
e.log_to_discord = log_settings[i].log_to_discord;
|
||||||
db_categories_to_add.emplace_back(new_category);
|
db_categories_to_add.emplace_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// look to see if the category name is different in the database
|
||||||
|
auto it = std::find_if(
|
||||||
|
categories.begin(),
|
||||||
|
categories.end(),
|
||||||
|
[i](const auto &c) { return c.log_category_id == i; }
|
||||||
|
);
|
||||||
|
if (it != categories.end()) {
|
||||||
|
if (it->log_category_description != Logs::LogCategoryName[i]) {
|
||||||
|
LogInfo(
|
||||||
|
"Updating log category [{}] ({}) to new name [{}]",
|
||||||
|
it->log_category_description,
|
||||||
|
i,
|
||||||
|
Logs::LogCategoryName[i]
|
||||||
|
);
|
||||||
|
it->log_category_description = Logs::LogCategoryName[i];
|
||||||
|
LogsysCategoriesRepository::ReplaceOne(*m_database, *it);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -194,8 +194,8 @@ namespace Logs {
|
|||||||
"Web Interface (Deprecated)",
|
"Web Interface (Deprecated)",
|
||||||
"World Server (Deprecated)",
|
"World Server (Deprecated)",
|
||||||
"Zone Server (Deprecated)",
|
"Zone Server (Deprecated)",
|
||||||
"QueryErr",
|
"MySQL Error",
|
||||||
"Query",
|
"MySQL Query",
|
||||||
"Mercenaries",
|
"Mercenaries",
|
||||||
"Quest Debug",
|
"Quest Debug",
|
||||||
"Legacy Packet Logging (Deprecated)",
|
"Legacy Packet Logging (Deprecated)",
|
||||||
@ -218,8 +218,8 @@ namespace Logs {
|
|||||||
"Emergency (Deprecated)",
|
"Emergency (Deprecated)",
|
||||||
"Alert (Deprecated)",
|
"Alert (Deprecated)",
|
||||||
"Notice (Deprecated)",
|
"Notice (Deprecated)",
|
||||||
"AI Scan",
|
"AI Scan Close",
|
||||||
"AI Yell",
|
"AI Yell For Help",
|
||||||
"AI CastBeneficial",
|
"AI CastBeneficial",
|
||||||
"AOE Cast",
|
"AOE Cast",
|
||||||
"Entity Management",
|
"Entity Management",
|
||||||
@ -237,7 +237,7 @@ namespace Logs {
|
|||||||
"DialogueWindow",
|
"DialogueWindow",
|
||||||
"HTTP",
|
"HTTP",
|
||||||
"Saylink",
|
"Saylink",
|
||||||
"ChecksumVer",
|
"Checksum Verification",
|
||||||
"CombatRecord",
|
"CombatRecord",
|
||||||
"Hate",
|
"Hate",
|
||||||
"Discord",
|
"Discord",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user