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/net/manaserv/inventoryhandler.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/net/manaserv/inventoryhandler.cpp')
-rw-r--r-- | src/net/manaserv/inventoryhandler.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/net/manaserv/inventoryhandler.cpp b/src/net/manaserv/inventoryhandler.cpp index 58a495af..fa31b32a 100644 --- a/src/net/manaserv/inventoryhandler.cpp +++ b/src/net/manaserv/inventoryhandler.cpp @@ -88,9 +88,8 @@ void EquipBackend::equip(int inventorySlot, int equipmentSlot) auto slotIt = mSlots.find(equipmentSlot); if (slotIt == mSlots.end()) { - logger->log("ManaServ::EquipBackend: Equipment slot %i" - " is not existing.", - equipmentSlot); + Log::info("ManaServ::EquipBackend: Equipment slot %i" + " is not existing.", equipmentSlot); return; } @@ -115,8 +114,8 @@ void EquipBackend::unequip(int inventorySlot) } } - logger->log("ManaServ::EquipBackend: No equipped item found at inventory " - "slot %i!", inventorySlot); + Log::info("ManaServ::EquipBackend: No equipped item found at inventory " + "slot %i!", inventorySlot); } void EquipBackend::event(Event::Channel, const Event &event) @@ -134,8 +133,8 @@ void EquipBackend::readEquipFile() if (!rootNode || rootNode.name() != "equip-slots") { - logger->log("ManaServ::EquipBackend: Error while reading " - EQUIP_FILE "!"); + Log::info("ManaServ::EquipBackend: Error while reading " + EQUIP_FILE "!"); return; } |