diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2025-07-04 12:13:01 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2025-07-04 21:17:55 +0200 |
commit | 1debcc8032f01dd2bb64f2725143121b57320876 (patch) | |
tree | 85cba14f5309a487913c0c430811273343211f8f /src/configuration.cpp | |
parent | 3fb53be63095dad2ebcfd52d44f13d20f630e478 (diff) | |
download | mana-1debcc8032f01dd2bb64f2725143121b57320876.tar.gz mana-1debcc8032f01dd2bb64f2725143121b57320876.tar.bz2 mana-1debcc8032f01dd2bb64f2725143121b57320876.tar.xz mana-1debcc8032f01dd2bb64f2725143121b57320876.zip |
Added logging priorities and use SDLs logging facilities
By using SDL logging, we can rely on SDL to filter the log messages by
their priority before they get sent to our custom output function. For
example, we now no longer get entries for created and destroyed Window
instances by default, since these have only "debug" priority whereas the
default priority for the "app" category is "info".
We can also get log messages raised by SDL itself in our log now. Log
levels can be controlled per category through the "SDL_LOGGING"
environment variable.
Many existing log messages have been assigned a category based on their
existing prefix.
Diffstat (limited to 'src/configuration.cpp')
-rw-r--r-- | src/configuration.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/configuration.cpp b/src/configuration.cpp index 10398d6f..e220f4c6 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -107,9 +107,9 @@ VariableData *Configuration::getDefault(const std::string &key, return itdef->second; } - logger->log("%s: No value in registry for key %s", - mConfigPath.c_str(), - key.c_str()); + Log::info("%s: No value in registry for key %s", + mConfigPath.c_str(), + key.c_str()); } return nullptr; @@ -214,13 +214,13 @@ void Configuration::init(const std::string &filename, bool useResManager) if (!rootNode) { - logger->log("Couldn't open configuration file: %s", filename.c_str()); + Log::info("Couldn't open configuration file: %s", filename.c_str()); return; } if (rootNode.name() != "configuration") { - logger->log("Warning: No configuration file (%s)", filename.c_str()); + Log::warn("No configuration file (%s)", filename.c_str()); return; } |