From 76a4cac36f46220d5a58738d4014a22ae8561705 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Fri, 25 Oct 2024 13:54:23 -0400
Subject: [PATCH] namedirectory, contacts: update logs

Change-Id: I3724246ed2cc07be23cbb3a9dcfaaf4dcbdd5717
---
 src/jamidht/contact_list.cpp  | 11 +++++------
 src/jamidht/namedirectory.cpp |  2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/jamidht/contact_list.cpp b/src/jamidht/contact_list.cpp
index f096bd701..0480873f6 100644
--- a/src/jamidht/contact_list.cpp
+++ b/src/jamidht/contact_list.cpp
@@ -515,21 +515,20 @@ ContactList::foundAccountDevice(const std::shared_ptr<dht::crypto::Certificate>&
     // match certificate chain
     auto verifyResult = accountTrust_.verify(*crt);
     if (not verifyResult) {
-        JAMI_WARN("[Contacts] Found invalid account device: %s: %s",
-                  id.toString().c_str(),
-                  verifyResult.toString().c_str());
+        JAMI_WARNING("[Contacts] Found invalid account device: {:s}: {:s}",
+                  id, verifyResult.toString());
         return false;
     }
 
     // insert device
     auto it = knownDevices_.emplace(id, KnownDevice {crt, name, updated});
     if (it.second) {
-        JAMI_DBG("[Contacts] Found account device: %s %s", name.c_str(), id.toString().c_str());
+        JAMI_LOG("[Contacts] Found account device: {} {}", name, id);
         jami::Manager::instance().certStore(accountId_).pinCertificate(crt);
         if (crt->ocspResponse) {
             unsigned int status = crt->ocspResponse->getCertificateStatus();
             if (status == GNUTLS_OCSP_CERT_REVOKED) {
-                JAMI_ERR("Certificate %s has revoked OCSP status", id.to_c_str());
+                JAMI_ERROR("Certificate {} has revoked OCSP status", id);
                 trust_->setCertificateStatus(crt, dhtnet::tls::TrustStore::PermissionStatus::BANNED, false);
             }
         }
@@ -538,7 +537,7 @@ ContactList::foundAccountDevice(const std::shared_ptr<dht::crypto::Certificate>&
     } else {
         // update device name
         if (not name.empty() and it.first->second.name != name) {
-            JAMI_DBG("[Contacts] Updating device name: %s %s", name.c_str(), id.to_c_str());
+            JAMI_LOG("[Contacts] updating device name: {} {}", name, id);
             it.first->second.name = name;
             saveKnownDevices();
             callbacks_.devicesChanged(knownDevices_);
diff --git a/src/jamidht/namedirectory.cpp b/src/jamidht/namedirectory.cpp
index ffb384f32..d61fc8bab 100644
--- a/src/jamidht/namedirectory.cpp
+++ b/src/jamidht/namedirectory.cpp
@@ -486,7 +486,7 @@ NameDirectory::loadCache()
         std::lock_guard lock(dhtnet::fileutils::getFileLock(cachePath_));
         std::ifstream file(cachePath_);
         if (!file.is_open()) {
-            JAMI_DEBUG("Unable to load %s", cachePath_);
+            JAMI_DEBUG("Unable to load {}", cachePath_);
             return;
         }
         std::string line;
-- 
GitLab