Commit fc28fedc authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Various logs improvements (changed verbosity of some, removed others)

parent 6ed094a2
......@@ -352,14 +352,15 @@ list<shared_ptr<AbstractChatRoom>> Core::getChatRooms () const {
return rooms;
}
shared_ptr<AbstractChatRoom> Core::findChatRoom (const ConferenceId &conferenceId) const {
shared_ptr<AbstractChatRoom> Core::findChatRoom (const ConferenceId &conferenceId, bool logIfNotFound) const {
L_D();
auto it = d->chatRoomsById.find(conferenceId);
if (it != d->chatRoomsById.cend())
return it->second;
lInfo() << "Unable to find chat room in RAM: " << conferenceId << ".";
if (logIfNotFound)
lInfo() << "Unable to find chat room in RAM: " << conferenceId << ".";
return nullptr;
}
......
......@@ -107,7 +107,7 @@ public:
std::list<std::shared_ptr<AbstractChatRoom>> getChatRooms () const;
std::shared_ptr<AbstractChatRoom> findChatRoom (const ConferenceId &conferenceId) const;
std::shared_ptr<AbstractChatRoom> findChatRoom (const ConferenceId &conferenceId, bool logIfNotFound = true) const;
std::list<std::shared_ptr<AbstractChatRoom>> findChatRooms (const IdentityAddress &peerAddress) const;
std::shared_ptr<AbstractChatRoom> findOneToOneChatRoom (
......
......@@ -36,13 +36,13 @@ class SmartTransaction {
public:
SmartTransaction (soci::session *session, const char *name) :
mSession(session), mName(name), mIsCommitted(false) {
lInfo() << "Start transaction " << this << " in MainDb::" << mName << ".";
lDebug() << "Start transaction " << this << " in MainDb::" << mName << ".";
mSession->begin();
}
~SmartTransaction () {
if (!mIsCommitted) {
lInfo() << "Rollback transaction " << this << " in MainDb::" << mName << ".";
lDebug() << "Rollback transaction " << this << " in MainDb::" << mName << ".";
mSession->rollback();
}
}
......@@ -53,7 +53,7 @@ public:
return;
}
lInfo() << "Commit transaction " << this << " in MainDb::" << mName << ".";
lDebug() << "Commit transaction " << this << " in MainDb::" << mName << ".";
mIsCommitted = true;
mSession->commit();
}
......
......@@ -2629,7 +2629,7 @@ list<shared_ptr<AbstractChatRoom>> MainDb::getChatRooms () const {
IdentityAddress(row.get<string>(2))
);
shared_ptr<AbstractChatRoom> chatRoom = core->findChatRoom(conferenceId);
shared_ptr<AbstractChatRoom> chatRoom = core->findChatRoom(conferenceId, false);
if (chatRoom) {
chatRooms.push_back(chatRoom);
continue;
......@@ -2741,7 +2741,7 @@ list<shared_ptr<AbstractChatRoom>> MainDb::getChatRooms () const {
dChatRoom->setCreationTime(creationTime);
dChatRoom->setLastUpdateTime(lastUpdateTime);
lInfo() << "Found chat room in DB: (peer=" <<
lDebug() << "Found chat room in DB: (peer=" <<
conferenceId.getPeerAddress().asString() << ", local=" << conferenceId.getLocalAddress().asString() << ").";
chatRooms.push_back(chatRoom);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment