diff --git a/src/ca-module.cpp b/src/ca-module.cpp
index caba70d..097c0d7 100644
--- a/src/ca-module.cpp
+++ b/src/ca-module.cpp
@@ -40,7 +40,7 @@
 static const time::seconds DEFAULT_DATA_FRESHNESS_PERIOD = 1_s;
 static const time::seconds REQUEST_VALIDITY_PERIOD_NOT_BEFORE_GRACE_PERIOD = 120_s;
 
-_LOG_INIT(ndncert.ca);
+NDN_LOG_INIT(ndncert.ca);
 
 CaModule::CaModule(Face& face, security::KeyChain& keyChain,
                    const std::string& configPath, const std::string& storageType)
@@ -102,7 +102,7 @@
         filterId = m_face.setInterestFilter(Name(name).append("REVOKE"),
                                             bind(&CaModule::onNewRenewRevoke, this, _2, RequestType::REVOKE));
         m_interestFilterHandles.push_back(filterId);
-        _LOG_TRACE("Prefix " << name << " got registered");
+        NDN_LOG_TRACE("Prefix " << name << " got registered");
       },
       bind(&CaModule::onRegisterFailed, this, _2));
   m_registeredPrefixHandles.push_back(prefixId);
@@ -136,7 +136,7 @@
 void
 CaModule::onCaProfileDiscovery(const Interest& request)
 {
-  _LOG_TRACE("Received CA Profile MetaData discovery Interest");
+  NDN_LOG_TRACE("Received CA Profile MetaData discovery Interest");
   if (m_profileData == nullptr) {
     m_profileData = std::make_unique<Data>(getCaProfileData());
   }
@@ -152,7 +152,7 @@
 CaModule::onProbe(const Interest& request)
 {
   // PROBE Naming Convention: /<CA-Prefix>/CA/PROBE/[ParametersSha256DigestComponent]
-  _LOG_TRACE("Received PROBE request");
+  NDN_LOG_TRACE("Received PROBE request");
 
   // process PROBE requests: collect probe parameters
   auto parameters = PROBE::decodeApplicationParameters(request.getApplicationParameters());
@@ -179,7 +179,7 @@
   result.setFreshnessPeriod(DEFAULT_DATA_FRESHNESS_PERIOD);
   m_keyChain.sign(result, signingByIdentity(m_config.m_caItem.m_caPrefix));
   m_face.put(result);
-  _LOG_TRACE("Handle PROBE: send out the PROBE response");
+  NDN_LOG_TRACE("Handle PROBE: send out the PROBE response");
 }
 
 void
@@ -196,20 +196,20 @@
   }
   catch (const std::exception& e) {
     if (!parameterTLV.hasValue()) {
-      _LOG_ERROR("Empty TLV obtained from the Interest parameter.");
+      NDN_LOG_ERROR("Empty TLV obtained from the Interest parameter.");
       m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
                                          "Empty TLV obtained from the Interest parameter."));
       return;
     }
 
-    _LOG_ERROR("Unrecognized self-signed certificate: " << e.what());
+    NDN_LOG_ERROR("Unrecognized self-signed certificate: " << e.what());
     m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
                                        "Unrecognized self-signed certificate."));
     return;
   }
 
   if (ecdhPub == "") {
-    _LOG_ERROR("Empty ECDH PUB obtained from the Interest parameter.");
+    NDN_LOG_ERROR("Empty ECDH PUB obtained from the Interest parameter.");
     m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
                                        "Empty ECDH PUB obtained from the Interest parameter."));
     return;
@@ -222,7 +222,7 @@
     ecdh.deriveSecret(ecdhPub);
   }
   catch (const std::exception& e) {
-    _LOG_ERROR("Cannot derive a shared secret using the provided ECDH key: " << e.what());
+    NDN_LOG_ERROR("Cannot derive a shared secret using the provided ECDH key: " << e.what());
     m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
                                        "Cannot derive a shared secret using the provided ECDH key."));
     return;
@@ -238,14 +238,14 @@
   if (!m_config.m_caItem.m_caPrefix.isPrefixOf(clientCert->getIdentity())
       || !security::Certificate::isValidName(clientCert->getName())
       || clientCert->getIdentity().size() <= m_config.m_caItem.m_caPrefix.size()) {
-      _LOG_ERROR("An invalid certificate name is being requested " << clientCert->getName());
+      NDN_LOG_ERROR("An invalid certificate name is being requested " << clientCert->getName());
       m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::NAME_NOT_ALLOWED,
                                          "An invalid certificate name is being requested."));
       return;
   }
   if (m_config.m_caItem.m_maxSuffixLength) {
     if (clientCert->getIdentity().size() > m_config.m_caItem.m_caPrefix.size() + *m_config.m_caItem.m_maxSuffixLength) {
-      _LOG_ERROR("An invalid certificate name is being requested " << clientCert->getName());
+      NDN_LOG_ERROR("An invalid certificate name is being requested " << clientCert->getName());
       m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::NAME_NOT_ALLOWED,
                                          "An invalid certificate name is being requested."));
       return;
@@ -259,7 +259,7 @@
     if (expectedPeriod.first < currentTime - REQUEST_VALIDITY_PERIOD_NOT_BEFORE_GRACE_PERIOD ||
         expectedPeriod.second > currentTime + m_config.m_caItem.m_maxValidityPeriod ||
         expectedPeriod.second <= expectedPeriod.first) {
-      _LOG_ERROR("An invalid validity period is being requested.");
+      NDN_LOG_ERROR("An invalid validity period is being requested.");
       m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::BAD_VALIDITY_PERIOD,
                                          "An invalid validity period is being requested."));
       return;
@@ -267,13 +267,13 @@
 
     // verify signature
     if (!security::verifySignature(*clientCert, *clientCert)) {
-      _LOG_ERROR("Invalid signature in the self-signed certificate.");
+      NDN_LOG_ERROR("Invalid signature in the self-signed certificate.");
       m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::BAD_SIGNATURE,
                                          "Invalid signature in the self-signed certificate."));
       return;
     }
     if (!security::verifySignature(request, *clientCert)) {
-      _LOG_ERROR("Invalid signature in the Interest packet.");
+      NDN_LOG_ERROR("Invalid signature in the Interest packet.");
       m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::BAD_SIGNATURE,
                                          "Invalid signature in the Interest packet."));
       return;
@@ -283,7 +283,7 @@
     //verify cert is from this CA
     const auto& cert = m_keyChain.getPib().getIdentity(m_config.m_caItem.m_caPrefix).getDefaultKey().getDefaultCertificate();
     if (!security::verifySignature(*clientCert, cert)) {
-      _LOG_ERROR("Invalid signature in the certificate to revoke.");
+      NDN_LOG_ERROR("Invalid signature in the certificate to revoke.");
       m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::BAD_SIGNATURE,
                                          "Invalid signature in the certificate to revoke."));
       return;
@@ -301,7 +301,7 @@
     m_storage->addRequest(requestState);
   }
   catch (const std::runtime_error& e) {
-    _LOG_ERROR("Duplicate Request ID: The same request has been seen before.");
+    NDN_LOG_ERROR("Duplicate Request ID: The same request has been seen before.");
     m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
                                        "Duplicate Request ID: The same request has been seen before.."));
     return;
@@ -326,14 +326,14 @@
   // get certificate request state
   CaState requestState = getCertificateRequest(request);
   if (requestState.m_requestId == "") {
-    _LOG_ERROR("No certificate request state can be found.");
+    NDN_LOG_ERROR("No certificate request state can be found.");
     m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
                                        "No certificate request state can be found."));
     return;
   }
   // verify signature
   if (!security::verifySignature(request, requestState.m_cert)) {
-    _LOG_ERROR("Invalid Signature in the Interest packet.");
+    NDN_LOG_ERROR("Invalid Signature in the Interest packet.");
     m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::BAD_SIGNATURE,
                                        "Invalid Signature in the Interest packet."));
     return;
@@ -345,14 +345,14 @@
                                                (uint8_t*)"test", strlen("test"));
   }
   catch (const std::exception& e) {
-    _LOG_ERROR("Interest paramaters decryption failed: " << e.what());
+    NDN_LOG_ERROR("Interest paramaters decryption failed: " << e.what());
     m_storage->deleteRequest(requestState.m_requestId);
     m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
                                        "Interest paramaters decryption failed."));
     return;
   }
   if (paramTLVPayload.size() == 0) {
-    _LOG_ERROR("No parameters are found after decryption.");
+    NDN_LOG_ERROR("No parameters are found after decryption.");
     m_storage->deleteRequest(requestState.m_requestId);
     m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
                                        "No parameters are found after decryption."));
@@ -365,13 +365,13 @@
   std::string challengeType = readString(paramTLV.get(tlv_selected_challenge));
   auto challenge = ChallengeModule::createChallengeModule(challengeType);
   if (challenge == nullptr) {
-    _LOG_TRACE("Unrecognized challenge type: " << challengeType);
+    NDN_LOG_TRACE("Unrecognized challenge type: " << challengeType);
     m_storage->deleteRequest(requestState.m_requestId);
     m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER, "Unrecognized challenge type."));
     return;
   }
 
-  _LOG_TRACE("CHALLENGE module to be load: " << challengeType);
+  NDN_LOG_TRACE("CHALLENGE module to be load: " << challengeType);
   auto errorInfo = challenge->handleChallengeRequest(paramTLV, requestState);
   if (std::get<0>(errorInfo) != ErrorCode::NO_ERROR) {
     m_storage->deleteRequest(requestState.m_requestId);
@@ -392,20 +392,20 @@
       payload.parse();
       payload.push_back(makeNestedBlock(tlv_issued_cert_name, issuedCert.getName()));
       payload.encode();
-      _LOG_TRACE("Challenge succeeded. Certificate has been issued: " << issuedCert.getName());
+      NDN_LOG_TRACE("Challenge succeeded. Certificate has been issued: " << issuedCert.getName());
     }
     else if (requestState.m_requestType == RequestType::REVOKE) {
       requestState.m_status = Status::SUCCESS;
       m_storage->deleteRequest(requestState.m_requestId);
 
       payload = CHALLENGE::encodeDataContent(requestState);
-      _LOG_TRACE("Challenge succeeded. Certificate has been revoked");
+      NDN_LOG_TRACE("Challenge succeeded. Certificate has been revoked");
     }
   }
   else {
     m_storage->updateRequest(requestState);
     payload = CHALLENGE::encodeDataContent(requestState);
-    _LOG_TRACE("No failure no success. Challenge moves on");
+    NDN_LOG_TRACE("No failure no success. Challenge moves on");
   }
 
   Data result;
@@ -433,14 +433,14 @@
   certName.append("NDNCERT").append(std::to_string(random::generateSecureWord64()));
   newCert.setName(certName);
   newCert.setContent(requestState.m_cert.getContent());
-  _LOG_TRACE("cert request content " << requestState.m_cert);
+  NDN_LOG_TRACE("cert request content " << requestState.m_cert);
   SignatureInfo signatureInfo;
   signatureInfo.setValidityPeriod(period);
   security::SigningInfo signingInfo(security::SigningInfo::SIGNER_TYPE_ID,
                                     m_config.m_caItem.m_caPrefix, signatureInfo);
 
   m_keyChain.sign(newCert, signingInfo);
-  _LOG_TRACE("new cert got signed" << newCert);
+  NDN_LOG_TRACE("new cert got signed" << newCert);
   return newCert;
 }
 
@@ -453,14 +453,14 @@
     requestId = readString(request.getName().at(m_config.m_caItem.m_caPrefix.size() + 2));
   }
   catch (const std::exception& e) {
-    _LOG_ERROR("Cannot read the request ID out from the request: " << e.what());
+    NDN_LOG_ERROR("Cannot read the request ID out from the request: " << e.what());
   }
   try {
-    _LOG_TRACE("Request Id to query the database " << requestId);
+    NDN_LOG_TRACE("Request Id to query the database " << requestId);
     requestState = m_storage->getRequest(requestId);
   }
   catch (const std::exception& e) {
-    _LOG_ERROR("Cannot get certificate request record from the storage: " << e.what());
+    NDN_LOG_ERROR("Cannot get certificate request record from the storage: " << e.what());
   }
   return requestState;
 }
@@ -468,7 +468,7 @@
 void
 CaModule::onRegisterFailed(const std::string& reason)
 {
-  _LOG_ERROR("Failed to register prefix in local hub's daemon, REASON: " << reason);
+  NDN_LOG_ERROR("Failed to register prefix in local hub's daemon, REASON: " << reason);
 }
 
 Data
diff --git a/src/crypto-support/crypto-helper.cpp b/src/crypto-support/crypto-helper.cpp
index e28da4c..916bee4 100644
--- a/src/crypto-support/crypto-helper.cpp
+++ b/src/crypto-support/crypto-helper.cpp
@@ -36,7 +36,7 @@
 
 const size_t HASH_SIZE = 32;
 
-_LOG_INIT(crypto-support);
+NDN_LOG_INIT(ndncert.crypto-support);
 
 ECDHState::ECDHState()
 {
@@ -377,7 +377,7 @@
 void
 handleErrors(const std::string& errorInfo)
 {
-  _LOG_DEBUG("Error in CRYPTO SUPPORT " << errorInfo);
+  NDN_LOG_DEBUG("Error in CRYPTO SUPPORT " << errorInfo);
   BOOST_THROW_EXCEPTION(CryptoError("Error in CRYPTO SUPPORT: " + errorInfo));
 }
 
diff --git a/src/identity-challenge/challenge-credential.cpp b/src/identity-challenge/challenge-credential.cpp
index e8cedf6..9cb54a6 100644
--- a/src/identity-challenge/challenge-credential.cpp
+++ b/src/identity-challenge/challenge-credential.cpp
@@ -27,7 +27,7 @@
 namespace ndn {
 namespace ndncert {
 
-_LOG_INIT(ndncert.challenge.credential);
+NDN_LOG_INIT(ndncert.challenge.credential);
 NDNCERT_REGISTER_CHALLENGE(ChallengeCredential, "Credential");
 
 const std::string ChallengeCredential::PARAMETER_KEY_CREDENTIAL_CERT = "issued-cert";
@@ -67,7 +67,7 @@
     std::istringstream ss(it->second.get("certificate", ""));
     auto cert = io::load<security::Certificate>(ss);
     if (cert == nullptr) {
-      _LOG_ERROR("Cannot load the certificate from config file");
+      NDN_LOG_ERROR("Cannot load the certificate from config file");
       continue;
     }
     m_trustAnchors.push_back(*cert);
@@ -93,7 +93,7 @@
           credential.wireDecode(elements[i + 1].blockFromValue());
         }
         catch (const std::exception& e) {
-          _LOG_ERROR("Cannot load challenge parameter: credential " << e.what());
+          NDN_LOG_ERROR("Cannot load challenge parameter: credential " << e.what());
           return returnWithError(request, ErrorCode::INVALID_PARAMETER, "Cannot challenge credential: credential." + std::string(e.what()));
         }
       }
@@ -118,7 +118,7 @@
     }
   }
 
-  _LOG_TRACE("Cannot verify the proof of private key against credential");
+  NDN_LOG_TRACE("Cannot verify the proof of private key against credential");
   return returnWithError(request, ErrorCode::INVALID_PARAMETER, "Cannot verify the proof of private key against credential.");
 }
 
diff --git a/src/identity-challenge/challenge-email.cpp b/src/identity-challenge/challenge-email.cpp
index 4e2e249..39dd162 100644
--- a/src/identity-challenge/challenge-email.cpp
+++ b/src/identity-challenge/challenge-email.cpp
@@ -24,7 +24,7 @@
 namespace ndn {
 namespace ndncert {
 
-_LOG_INIT(ndncert.challenge.email);
+NDN_LOG_INIT(ndncert.challenge.email);
 NDNCERT_REGISTER_CHALLENGE(ChallengeEmail, "email");
 
 const std::string ChallengeEmail::NEED_CODE = "need-code";
@@ -55,20 +55,20 @@
     }
     auto lastComponentRequested = readString(request.m_cert.getIdentity().get(-1));
     if (lastComponentRequested != emailAddress) {
-      _LOG_TRACE("Email and requested name do not match. Email " << emailAddress << "requested last component " << lastComponentRequested);
+      NDN_LOG_TRACE("Email and requested name do not match. Email " << emailAddress << "requested last component " << lastComponentRequested);
     }
     std::string emailCode = generateSecretCode();
     JsonSection secretJson;
     secretJson.add(PARAMETER_KEY_CODE, emailCode);
     // send out the email
     sendEmail(emailAddress, emailCode, request);
-    _LOG_TRACE("Secret for request " << request.m_requestId << " : " << emailCode);
+    NDN_LOG_TRACE("Secret for request " << request.m_requestId << " : " << emailCode);
     return returnWithNewChallengeStatus(request, NEED_CODE, std::move(secretJson), m_maxAttemptTimes, m_secretLifetime);
   }
   if (request.m_challengeState) {
     if (request.m_challengeState->m_challengeStatus == NEED_CODE ||
         request.m_challengeState->m_challengeStatus == WRONG_CODE) {
-      _LOG_TRACE("Challenge Interest arrives. Challenge Status: " << request.m_challengeState->m_challengeStatus);
+      NDN_LOG_TRACE("Challenge Interest arrives. Challenge Status: " << request.m_challengeState->m_challengeStatus);
       // the incoming interest should bring the pin code
       std::string givenCode = readString(params.get(tlv_parameter_value));
       auto secret = request.m_challengeState->m_secrets;
@@ -79,20 +79,20 @@
       // check if provided secret is correct
       if (givenCode == secret.get<std::string>(PARAMETER_KEY_CODE)) {
         // the code is correct
-        _LOG_TRACE("Correct secret code. Challenge succeeded.");
+        NDN_LOG_TRACE("Correct secret code. Challenge succeeded.");
         return returnWithSuccess(request);
       }
       // otherwise, check remaining attempt times
       if (request.m_challengeState->m_remainingTries > 1) {
         auto remainTime = m_secretLifetime - (currentTime - request.m_challengeState->m_timestamp);
-        _LOG_TRACE("Wrong secret code provided. Remaining Tries - 1.");
+        NDN_LOG_TRACE("Wrong secret code provided. Remaining Tries - 1.");
         return returnWithNewChallengeStatus(request, WRONG_CODE, std::move(secret),
                                             request.m_challengeState->m_remainingTries - 1,
                                             time::duration_cast<time::seconds>(remainTime));
       }
       else {
         // run out times
-        _LOG_TRACE("Wrong secret code provided. Ran out tires. Challenge failed.");
+        NDN_LOG_TRACE("Wrong secret code provided. Ran out tires. Challenge failed.");
         return returnWithError(request, ErrorCode::OUT_OF_TRIES, "Ran out tires.");
       }
     }
@@ -163,9 +163,9 @@
   command += " \"" + emailAddress + "\" \"" + secret + "\" \"" + request.m_caPrefix.toUri() + "\" \"" + request.m_cert.getName().toUri() + "\"";
   int result = system(command.c_str());
   if (result == -1) {
-    _LOG_TRACE("EmailSending Script " + m_sendEmailScript + " fails.");
+    NDN_LOG_TRACE("EmailSending Script " + m_sendEmailScript + " fails.");
   }
-  _LOG_TRACE("EmailSending Script " + m_sendEmailScript +
+  NDN_LOG_TRACE("EmailSending Script " + m_sendEmailScript +
              " was executed successfully with return value" + std::to_string(result) + ".");
   return;
 }
diff --git a/src/identity-challenge/challenge-pin.cpp b/src/identity-challenge/challenge-pin.cpp
index cd2c03e..d7416c5 100644
--- a/src/identity-challenge/challenge-pin.cpp
+++ b/src/identity-challenge/challenge-pin.cpp
@@ -24,7 +24,7 @@
 namespace ndn {
 namespace ndncert {
 
-_LOG_INIT(ndncert.challenge.pin);
+NDN_LOG_INIT(ndncert.challenge.pin);
 NDNCERT_REGISTER_CHALLENGE(ChallengePin, "pin");
 
 const std::string ChallengePin::NEED_CODE = "need-code";
@@ -43,18 +43,18 @@
   params.parse();
   auto currentTime = time::system_clock::now();
   if (request.m_status == Status::BEFORE_CHALLENGE) {
-    _LOG_TRACE("Challenge Interest arrives. Init the challenge");
+    NDN_LOG_TRACE("Challenge Interest arrives. Init the challenge");
     // for the first time, init the challenge
     std::string secretCode = generateSecretCode();
     JsonSection secretJson;
     secretJson.add(PARAMETER_KEY_CODE, secretCode);
-    _LOG_TRACE("Secret for request " << request.m_requestId << " : " << secretCode);
+    NDN_LOG_TRACE("Secret for request " << request.m_requestId << " : " << secretCode);
     return returnWithNewChallengeStatus(request, NEED_CODE, std::move(secretJson), m_maxAttemptTimes, m_secretLifetime);
   }
   if (request.m_challengeState) {
     if (request.m_challengeState->m_challengeStatus == NEED_CODE ||
         request.m_challengeState->m_challengeStatus == WRONG_CODE) {
-      _LOG_TRACE("Challenge Interest arrives. Challenge Status: " << request.m_challengeState->m_challengeStatus);
+      NDN_LOG_TRACE("Challenge Interest arrives. Challenge Status: " << request.m_challengeState->m_challengeStatus);
       // the incoming interest should bring the pin code
       std::string givenCode = readString(params.get(tlv_parameter_value));
       auto secret = request.m_challengeState->m_secrets;
@@ -62,20 +62,20 @@
         return returnWithError(request, ErrorCode::OUT_OF_TIME, "Secret expired.");
       }
       if (givenCode == secret.get<std::string>(PARAMETER_KEY_CODE)) {
-        _LOG_TRACE("Correct PIN code. Challenge succeeded.");
+        NDN_LOG_TRACE("Correct PIN code. Challenge succeeded.");
         return returnWithSuccess(request);
       }
       // check rest attempt times
       if (request.m_challengeState->m_remainingTries > 1) {
         auto remainTime = m_secretLifetime - (currentTime - request.m_challengeState->m_timestamp);
-        _LOG_TRACE("Wrong PIN code provided. Remaining Tries - 1.");
+        NDN_LOG_TRACE("Wrong PIN code provided. Remaining Tries - 1.");
         return returnWithNewChallengeStatus(request, WRONG_CODE, std::move(secret),
                                             request.m_challengeState->m_remainingTries - 1,
                                             time::duration_cast<time::seconds>(remainTime));
       }
       else {
         // run out times
-        _LOG_TRACE("Wrong PIN code provided. Ran out tires. Challenge failed.");
+        NDN_LOG_TRACE("Wrong PIN code provided. Ran out tires. Challenge failed.");
         return returnWithError(request, ErrorCode::OUT_OF_TRIES, "Ran out tires.");
       }
     }
diff --git a/src/ndncert-common.hpp b/src/ndncert-common.hpp
index cffef1a..c458be7 100644
--- a/src/ndncert-common.hpp
+++ b/src/ndncert-common.hpp
@@ -62,14 +62,7 @@
 namespace ndncert {
 
 using boost::noncopyable;
-using ndn::Block;
-using ndn::Data;
-using ndn::Interest;
-using ndn::make_unique;
-using ndn::Name;
-using ndn::PartialName;
-using ndn::time::system_clock;
-using ndn::time::toUnixTimestamp;
+using time::system_clock;
 using std::bind;
 using std::enable_shared_from_this;
 using std::function;
@@ -79,11 +72,6 @@
 using std::unique_ptr;
 using std::weak_ptr;
 
-#define _LOG_INIT(name) NDN_LOG_INIT(ndncert.name)
-#define _LOG_DEBUG(x) NDN_LOG_DEBUG(__FILE__ << ":" << __LINE__ << ":" << " " << x)
-#define _LOG_TRACE(x) NDN_LOG_TRACE(__FILE__ << ":" << __LINE__ << ":" << " " << x)
-#define _LOG_ERROR(x) NDN_LOG_ERROR(x)
-
 enum : uint32_t {
   tlv_ca_prefix = 129,
   tlv_ca_info = 131,
diff --git a/src/protocol-detail/new-renew-revoke.cpp b/src/protocol-detail/new-renew-revoke.cpp
index 2fecb4d..f153c40 100644
--- a/src/protocol-detail/new-renew-revoke.cpp
+++ b/src/protocol-detail/new-renew-revoke.cpp
@@ -28,7 +28,7 @@
 namespace ndn {
 namespace ndncert {
 
-_LOG_INIT(ndncert.encoding.new_renew_revoke);
+NDN_LOG_INIT(ndncert.encoding.new_renew_revoke);
 
 Block
 NEW_RENEW_REVOKE::encodeApplicationParameters(RequestType requestType, const std::string& ecdhPub, const security::Certificate& certRequest)
@@ -41,7 +41,7 @@
     >> security::transform::streamSink(ss);
   }
   catch (const security::transform::Error& e) {
-    _LOG_ERROR("Cannot convert self-signed cert into BASE64 string " << e.what());
+    NDN_LOG_ERROR("Cannot convert self-signed cert into BASE64 string " << e.what());
     return request;
   }
 
diff --git a/src/requester.cpp b/src/requester.cpp
index 4cb4135..16665a3 100644
--- a/src/requester.cpp
+++ b/src/requester.cpp
@@ -38,7 +38,7 @@
 namespace ndn {
 namespace ndncert {
 
-_LOG_INIT(ndncert.client);
+NDN_LOG_INIT(ndncert.client);
 
 shared_ptr<Interest>
 Requester::genCaProfileDiscoveryInterest(const Name& caName)
@@ -66,7 +66,7 @@
 {
   auto caItem = INFO::decodeDataContent(reply.getContent());
   if (!security::verifySignature(reply, *caItem.m_cert)) {
-    _LOG_ERROR("Cannot verify replied Data packet signature.");
+    NDN_LOG_ERROR("Cannot verify replied Data packet signature.");
     BOOST_THROW_EXCEPTION(std::runtime_error("Cannot verify replied Data packet signature."));
   }
   return caItem;
@@ -80,7 +80,7 @@
   auto certBlock = caItem.m_cert->wireEncode();
   caItem.m_cert = std::make_shared<security::Certificate>(certBlock);
   if (caItem.m_cert->getFullName() != caCertFullName) {
-    _LOG_ERROR("Ca profile does not match the certificate information offered by the original CA.");
+    NDN_LOG_ERROR("Ca profile does not match the certificate information offered by the original CA.");
     BOOST_THROW_EXCEPTION(std::runtime_error("Cannot verify replied Data packet signature."));
   }
   return onCaProfileResponse(reply);
@@ -103,7 +103,7 @@
                            std::vector<std::pair<Name, int>>& identityNames, std::vector<Name>& otherCas)
 {
   if (!security::verifySignature(reply, *ca.m_cert)) {
-    _LOG_ERROR("Cannot verify replied Data packet signature.");
+    NDN_LOG_ERROR("Cannot verify replied Data packet signature.");
     BOOST_THROW_EXCEPTION(std::runtime_error("Cannot verify replied Data packet signature."));
     return;
   }
@@ -192,7 +192,7 @@
 Requester::onNewRenewRevokeResponse(RequesterState& state, const Data& reply)
 {
   if (!security::verifySignature(reply, *state.m_caItem.m_cert)) {
-    _LOG_ERROR("Cannot verify replied Data packet signature.");
+    NDN_LOG_ERROR("Cannot verify replied Data packet signature.");
     BOOST_THROW_EXCEPTION(std::runtime_error("Cannot verify replied Data packet signature."));
   }
   processIfError(reply);
@@ -254,7 +254,7 @@
 Requester::onChallengeResponse(RequesterState& state, const Data& reply)
 {
   if (!security::verifySignature(reply, *state.m_caItem.m_cert)) {
-    _LOG_ERROR("Cannot verify replied Data packet signature.");
+    NDN_LOG_ERROR("Cannot verify replied Data packet signature.");
     BOOST_THROW_EXCEPTION(std::runtime_error("Cannot verify replied Data packet signature."));
   }
   processIfError(reply);
@@ -280,7 +280,7 @@
     return std::make_shared<security::Certificate>(reply);
   }
   catch (const std::exception& e) {
-    _LOG_ERROR("Cannot parse replied certificate ");
+    NDN_LOG_ERROR("Cannot parse replied certificate ");
     BOOST_THROW_EXCEPTION(std::runtime_error("Cannot parse replied certificate "));
     return nullptr;
   }
@@ -312,7 +312,7 @@
   if (std::get<0>(errorInfo) == ErrorCode::NO_ERROR) {
     return;
   }
-  _LOG_ERROR("Error info replied from the CA with Error code: " +
+  NDN_LOG_ERROR("Error info replied from the CA with Error code: " +
             errorCodeToString(std::get<0>(errorInfo)) +
             " and Error Info: " + std::get<1>(errorInfo));
   BOOST_THROW_EXCEPTION(std::runtime_error("Error info replied from the CA with Error code: " +
