Skip to content

Commit

Permalink
WIP: more announcement logging [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
askmeaboutlo0m committed Oct 1, 2024
1 parent 5d551e5 commit d2b1265
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions src/libserver/announcements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,24 @@ void Announcements::refreshListings()
const QUrl &refreshServer = it.key();
const Updates &updates = it.value();

server::Log()
.about(server::Log::Level::Info, server::Log::Topic::PubList)
.message(QStringLiteral("Refreshing %1 announcements at %2")
.arg(updates.size())
.arg(updates.first().first.apiUrl.toString()))
.to(m_config->logger());
int updateCount = updates.size();
if(updateCount == 1) {
const Update &update = updates.first();
server::Log()
.about(server::Log::Level::Info, server::Log::Topic::PubList)
.message(
QStringLiteral(
"Refreshing announcement for session %1 at %2")
.arg(update.second.id, update.first.apiUrl.toString()))
.to(m_config->logger());
} else {
server::Log()
.about(server::Log::Level::Info, server::Log::Topic::PubList)
.message(QStringLiteral("Refreshing %1 announcements at %2")
.arg(updates.size())
.arg(updates.first().first.apiUrl.toString()))
.to(m_config->logger());
}

AnnouncementApiResponse *response =
sessionlisting::refreshSessions(updates);
Expand Down Expand Up @@ -257,7 +269,16 @@ void Announcements::refreshListings()
QString::number(listing->announcement.listingId);
const QString resultValue =
responses.value(listingId).toString();
if(resultValue != QStringLiteral("ok")) {
if(resultValue == QStringLiteral("ok")) {
server::Log()
.about(
server::Log::Level::Info,
server::Log::Topic::PubList)
.session(listing->announcement.id)
.message(QStringLiteral("%1: %2").arg(
listing->listServer.toString(), resultValue))
.to(m_config->logger());
} else {
QString errorMessage = errors[listingId].toString();
server::Log()
.about(
Expand Down

0 comments on commit d2b1265

Please sign in to comment.