remove _LOG_XX
Change-Id: Iace32ffec68a8561465f49b217200c3a7590c273
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.");
}
}