Skip to content

Commit dce570e

Browse files
committed
added logs to hasItem function in the manager class
1 parent b5b2b3e commit dce570e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/t_manager/ItemManager.tpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,17 @@ void ItemManager::displayRegisteredDeserializers() {
127127

128128
bool ItemManager::hasItem(const std::string& tag) const {
129129
std::lock_guard<std::mutex> lock(mutex_);
130-
return items.find(tag) != items.end();
130+
if (tag.empty()) {
131+
LOG_CONTEXT(LogLevel::WARNING, "Empty tag provided for hasItem check", false);
132+
return false;
133+
}
134+
if(items.find(tag) != items.end()){
135+
LOG_CONTEXT(LogLevel::DEBUG, "Item with tag '" + tag + "' exists in ItemManager", true);
136+
return true;
137+
} else {
138+
LOG_CONTEXT(LogLevel::DEBUG, "Item with tag '" + tag + "' does not exist in ItemManager", false);
139+
return false;
140+
}
131141
}
132142

133143
std::string ItemManager::demangleType(const std::string& mangledName) const{

0 commit comments

Comments
 (0)