summaryrefslogtreecommitdiffstats
path: root/libtransport/src/auth
diff options
context:
space:
mode:
authorEnrico Loparco (eloparco) <eloparco@cisco.com>2022-09-19 08:37:30 +0000
committerEnrico Loparco <eloparco@cisco.com>2022-09-21 08:11:14 +0000
commit582e9a1b4275d89b02d020e1155ee8a0aff65d3b (patch)
tree78c3a86e4359f888ffa1450ffd753815fc5e9d20 /libtransport/src/auth
parent10e0758a2124e8d9d6253a9160e593303b38f71e (diff)
refactor(logs): use glog instead of prints
Ref: HICN-788 Signed-off-by: Enrico Loparco (eloparco) <eloparco@cisco.com> Change-Id: Iedf75e1658a335985cc2dfd7b82ae61124f2371e
Diffstat (limited to 'libtransport/src/auth')
-rw-r--r--libtransport/src/auth/crypto_hash.cc17
-rw-r--r--libtransport/src/auth/signer.cc3
2 files changed, 8 insertions, 12 deletions
diff --git a/libtransport/src/auth/crypto_hash.cc b/libtransport/src/auth/crypto_hash.cc
index 08be47aff..bc2d5248e 100644
--- a/libtransport/src/auth/crypto_hash.cc
+++ b/libtransport/src/auth/crypto_hash.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Cisco and/or its affiliates.
+ * Copyright (c) 2021-2022 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
@@ -13,11 +13,10 @@
* limitations under the License.
*/
+#include <glog/logging.h>
#include <hicn/transport/auth/crypto_hash.h>
#include <hicn/transport/core/global_object_pool.h>
-#include "glog/logging.h"
-
namespace transport {
namespace auth {
@@ -137,23 +136,21 @@ void CryptoHash::setType(CryptoHashType hash_type) {
void CryptoHash::display() {
switch (digest_type_) {
case CryptoHashType::SHA256:
- std::cout << "SHA256";
+ LOG(INFO) << "SHA256: " << getStringDigest();
break;
case CryptoHashType::SHA512:
- std::cout << "SHA512";
+ LOG(INFO) << "SHA512: " << getStringDigest();
break;
case CryptoHashType::BLAKE2S256:
- std::cout << "BLAKE2s256";
+ LOG(INFO) << "BLAKE2s256: " << getStringDigest();
break;
case CryptoHashType::BLAKE2B512:
- std::cout << "BLAKE2b512";
+ LOG(INFO) << "BLAKE2b512: " << getStringDigest();
break;
default:
- std::cout << "UNKNOWN";
+ LOG(INFO) << "UNKNOWN: " << getStringDigest();
break;
}
-
- std::cout << ": " << getStringDigest() << std::endl;
}
void CryptoHash::reset() {
diff --git a/libtransport/src/auth/signer.cc b/libtransport/src/auth/signer.cc
index 500732ba1..484180108 100644
--- a/libtransport/src/auth/signer.cc
+++ b/libtransport/src/auth/signer.cc
@@ -200,8 +200,7 @@ CryptoHashType Signer::getHashType() const {
}
void Signer::display() {
- std::cout << getStringSuite(suite_) << ": " << getStringSignature()
- << std::endl;
+ LOG(INFO) << getStringSuite(suite_) << ": " << getStringSignature();
}
// ---------------------------------------------------------