From 004cab13dc19a5885942b5d25062160ed5acef68 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 30 Jul 2022 11:26:51 +0200 Subject: [PATCH] sys: Replaced many info logs with debug logs --- lib/libimhex/include/hex/helpers/logger.hpp | 2 +- lib/libimhex/source/api/content_registry.cpp | 38 +++++++++---------- .../source/content/views/view_settings.cpp | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/libimhex/include/hex/helpers/logger.hpp b/lib/libimhex/include/hex/helpers/logger.hpp index 6bd22b21b..8f1af3eb3 100644 --- a/lib/libimhex/include/hex/helpers/logger.hpp +++ b/lib/libimhex/include/hex/helpers/logger.hpp @@ -41,7 +41,7 @@ namespace hex::log { [[maybe_unused]] void debug(const std::string &fmt, auto &&...args) { #if defined(DEBUG) - hex::log::print(fg(fmt::color::green_yellow) | fmt::emphasis::bold, "[DEBUG]", fmt, args...); + hex::log::print(fg(fmt::color::light_green) | fmt::emphasis::bold, "[DEBUG]", fmt, args...); #else hex::unused(fmt, args...); #endif diff --git a/lib/libimhex/source/api/content_registry.cpp b/lib/libimhex/source/api/content_registry.cpp index 588cc9e75..13ccef7fa 100644 --- a/lib/libimhex/source/api/content_registry.cpp +++ b/lib/libimhex/source/api/content_registry.cpp @@ -63,7 +63,7 @@ namespace hex { } void add(const std::string &unlocalizedCategory, const std::string &unlocalizedName, i64 defaultValue, const Callback &callback, bool requiresRestart) { - log::info("Registered new integer setting: [{}]: {}", unlocalizedCategory, unlocalizedName); + log::debug("Registered new integer setting: [{}]: {}", unlocalizedCategory, unlocalizedName); getCategoryEntry(unlocalizedCategory)->second.emplace_back(Entry { unlocalizedName, requiresRestart, callback }); @@ -76,7 +76,7 @@ namespace hex { } void add(const std::string &unlocalizedCategory, const std::string &unlocalizedName, const std::string &defaultValue, const Callback &callback, bool requiresRestart) { - log::info("Registered new string setting: [{}]: {}", unlocalizedCategory, unlocalizedName); + log::debug("Registered new string setting: [{}]: {}", unlocalizedCategory, unlocalizedName); getCategoryEntry(unlocalizedCategory)->second.emplace_back(Entry { unlocalizedName, requiresRestart, callback }); @@ -89,7 +89,7 @@ namespace hex { } void add(const std::string &unlocalizedCategory, const std::string &unlocalizedName, const std::vector &defaultValue, const Callback &callback, bool requiresRestart) { - log::info("Registered new string array setting: [{}]: {}", unlocalizedCategory, unlocalizedName); + log::debug("Registered new string array setting: [{}]: {}", unlocalizedCategory, unlocalizedName); getCategoryEntry(unlocalizedCategory)->second.emplace_back(Entry { unlocalizedName, requiresRestart, callback }); @@ -212,7 +212,7 @@ namespace hex { namespace ContentRegistry::CommandPaletteCommands { void add(Type type, const std::string &command, const std::string &unlocalizedDescription, const DisplayCallback &displayCallback, const ExecuteCallback &executeCallback) { - log::info("Registered new command palette command: {}", command); + log::debug("Registered new command palette command: {}", command); getEntries().push_back(ContentRegistry::CommandPaletteCommands::Entry { type, command, unlocalizedDescription, displayCallback, executeCallback }); } @@ -262,13 +262,13 @@ namespace hex { } void addPragma(const std::string &name, const pl::api::PragmaHandler &handler) { - log::info("Registered new pattern language pragma: {}", name); + log::debug("Registered new pattern language pragma: {}", name); getPragmas()[name] = handler; } void addFunction(const pl::api::Namespace &ns, const std::string &name, pl::api::FunctionParameterCount parameterCount, const pl::api::FunctionCallback &func) { - log::info("Registered new pattern language function: {}", getFunctionName(ns, name)); + log::debug("Registered new pattern language function: {}", getFunctionName(ns, name)); getFunctions().push_back({ ns, name, @@ -278,7 +278,7 @@ namespace hex { } void addDangerousFunction(const pl::api::Namespace &ns, const std::string &name, pl::api::FunctionParameterCount parameterCount, const pl::api::FunctionCallback &func) { - log::info("Registered new dangerous pattern language function: {}", getFunctionName(ns, name)); + log::debug("Registered new dangerous pattern language function: {}", getFunctionName(ns, name)); getFunctions().push_back({ ns, name, @@ -305,7 +305,7 @@ namespace hex { namespace ContentRegistry::Views { void impl::add(View *view) { - log::info("Registered new view: {}", view->getUnlocalizedName()); + log::debug("Registered new view: {}", view->getUnlocalizedName()); getEntries().insert({ view->getUnlocalizedName(), view }); } @@ -330,7 +330,7 @@ namespace hex { namespace ContentRegistry::Tools { void add(const std::string &unlocalizedName, const impl::Callback &function) { - log::info("Registered new tool: {}", unlocalizedName); + log::debug("Registered new tool: {}", unlocalizedName); getEntries().emplace_back(impl::Entry { unlocalizedName, function }); } @@ -346,7 +346,7 @@ namespace hex { namespace ContentRegistry::DataInspector { void add(const std::string &unlocalizedName, size_t requiredSize, impl::GeneratorFunction displayGeneratorFunction, std::optional editingFunction) { - log::info("Registered new data inspector format: {}", unlocalizedName); + log::debug("Registered new data inspector format: {}", unlocalizedName); getEntries().push_back({ unlocalizedName, requiredSize, std::move(displayGeneratorFunction), std::move(editingFunction) }); } @@ -362,7 +362,7 @@ namespace hex { namespace ContentRegistry::DataProcessorNode { void impl::add(const impl::Entry &entry) { - log::info("Registered new data processor node type: [{}]: {}", entry.category, entry.name); + log::debug("Registered new data processor node type: [{}]: {}", entry.category, entry.name); getEntries().push_back(entry); } @@ -382,13 +382,13 @@ namespace hex { namespace ContentRegistry::Language { void registerLanguage(const std::string &name, const std::string &languageCode) { - log::info("Registered new language: {} ({})", name, languageCode); + log::debug("Registered new language: {} ({})", name, languageCode); getLanguages().insert({ languageCode, name }); } void addLocalizations(const std::string &languageCode, const LanguageDefinition &definition) { - log::info("Registered new localization for language {} with {} entries", languageCode, definition.getEntries().size()); + log::debug("Registered new localization for language {} with {} entries", languageCode, definition.getEntries().size()); getLanguageDefinitions()[languageCode].push_back(definition); } @@ -410,13 +410,13 @@ namespace hex { namespace ContentRegistry::Interface { void registerMainMenuItem(const std::string &unlocalizedName, u32 priority) { - log::info("Registered new main menu item: {}", unlocalizedName); + log::debug("Registered new main menu item: {}", unlocalizedName); getMainMenuItems().insert({ priority, { unlocalizedName } }); } void addMenuItem(const std::string &unlocalizedMainMenuName, u32 priority, const impl::DrawCallback &function) { - log::info("Added new menu item to menu {} with priority {}", unlocalizedMainMenuName, priority); + log::debug("Added new menu item to menu {} with priority {}", unlocalizedMainMenuName, priority); getMenuItems().insert({ priority, {unlocalizedMainMenuName, function} @@ -444,7 +444,7 @@ namespace hex { } void addLayout(const std::string &unlocalizedName, const impl::LayoutFunction &function) { - log::info("Added new layout: {}", unlocalizedName); + log::debug("Added new layout: {}", unlocalizedName); getLayouts().push_back({ unlocalizedName, function }); } @@ -498,7 +498,7 @@ namespace hex { namespace ContentRegistry::Provider { void impl::addProviderName(const std::string &unlocalizedName) { - log::info("Registered new provider: {}", unlocalizedName); + log::debug("Registered new provider: {}", unlocalizedName); getEntries().push_back(unlocalizedName); } @@ -514,7 +514,7 @@ namespace hex { namespace ContentRegistry::DataFormatter { void add(const std::string &unlocalizedName, const impl::Callback &callback) { - log::info("Registered new data formatter: {}", unlocalizedName); + log::debug("Registered new data formatter: {}", unlocalizedName); getEntries().push_back({ unlocalizedName, callback }); } @@ -531,7 +531,7 @@ namespace hex { void add(const std::vector &extensions, const impl::Callback &callback) { for (const auto &extension : extensions) - log::info("Registered new data handler for extensions: {}", extension); + log::debug("Registered new data handler for extensions: {}", extension); getEntries().push_back({ extensions, callback }); } diff --git a/plugins/builtin/source/content/views/view_settings.cpp b/plugins/builtin/source/content/views/view_settings.cpp index 842053cff..275fba414 100644 --- a/plugins/builtin/source/content/views/view_settings.cpp +++ b/plugins/builtin/source/content/views/view_settings.cpp @@ -57,7 +57,7 @@ namespace hex::plugin::builtin { for (auto &[name, requiresRestart, callback] : settings) { if (callback(LangEntry(name), ContentRegistry::Settings::getSettingsData()[category.name][name])) { - log::info("Setting [{}]: {} was changed", category.name, name); + log::debug("Setting [{}]: {} was changed", category.name, name); EventManager::post(); if (requiresRestart)