merge logging.h into ndncert-common.h
Change-Id: I72f069533d19bf4dd3030b2a8c407e0f5b91a41d
diff --git a/src/ca-module.cpp b/src/ca-module.cpp
index 7439ef6..bf98856 100644
--- a/src/ca-module.cpp
+++ b/src/ca-module.cpp
@@ -21,7 +21,6 @@
#include "ca-module.hpp"
#include "challenge-module.hpp"
#include "crypto-support/enc-tlv.hpp"
-#include "logging.hpp"
#include "protocol-detail/challenge.hpp"
#include "protocol-detail/error.hpp"
#include "protocol-detail/info.hpp"
diff --git a/src/challenge-module/challenge-credential.cpp b/src/challenge-module/challenge-credential.cpp
index a79facb..a41aa56 100644
--- a/src/challenge-module/challenge-credential.cpp
+++ b/src/challenge-module/challenge-credential.cpp
@@ -18,13 +18,10 @@
*/
#include "challenge-credential.hpp"
-
#include <iostream>
#include <ndn-cxx/security/verification-helpers.hpp>
#include <ndn-cxx/util/io.hpp>
-#include "../logging.hpp"
-
namespace ndn {
namespace ndncert {
diff --git a/src/challenge-module/challenge-email.cpp b/src/challenge-module/challenge-email.cpp
index cac0084..aec7859 100644
--- a/src/challenge-module/challenge-email.cpp
+++ b/src/challenge-module/challenge-email.cpp
@@ -19,11 +19,8 @@
*/
#include "challenge-email.hpp"
-
-#include <regex>
-
#include "../ca-module.hpp"
-#include "../logging.hpp"
+#include <regex>
namespace ndn {
namespace ndncert {
diff --git a/src/challenge-module/challenge-pin.cpp b/src/challenge-module/challenge-pin.cpp
index 556929f..9302e42 100644
--- a/src/challenge-module/challenge-pin.cpp
+++ b/src/challenge-module/challenge-pin.cpp
@@ -19,11 +19,8 @@
*/
#include "challenge-pin.hpp"
-
#include <ndn-cxx/util/random.hpp>
-#include "logging.hpp"
-
namespace ndn {
namespace ndncert {
diff --git a/src/client-module.cpp b/src/client-module.cpp
index e83e8cb..0fbd07b 100644
--- a/src/client-module.cpp
+++ b/src/client-module.cpp
@@ -30,7 +30,6 @@
#include "challenge-module.hpp"
#include "crypto-support/enc-tlv.hpp"
-#include "logging.hpp"
#include "protocol-detail/challenge.hpp"
#include "protocol-detail/info.hpp"
#include "protocol-detail/new.hpp"
diff --git a/src/crypto-support/crypto-helper.cpp b/src/crypto-support/crypto-helper.cpp
index 8fba982..7813187 100644
--- a/src/crypto-support/crypto-helper.cpp
+++ b/src/crypto-support/crypto-helper.cpp
@@ -19,12 +19,9 @@
*/
#include "crypto-helper.hpp"
-#include "../logging.hpp"
-
#include <openssl/err.h>
#include <openssl/hmac.h>
#include <openssl/pem.h>
-
#include <ndn-cxx/encoding/buffer-stream.hpp>
#include <ndn-cxx/security/transform/base64-decode.hpp>
#include <ndn-cxx/security/transform/base64-encode.hpp>
diff --git a/src/logging.hpp b/src/logging.hpp
deleted file mode 100644
index 24b8c3f..0000000
--- a/src/logging.hpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2017, Regents of the University of California.
- *
- * This file is part of ndncert, a certificate management system based on NDN.
- *
- * ndncert is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation, either
- * version 3 of the License, or (at your option) any later version.
- *
- * ndncert is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received copies of the GNU General Public License along with
- * ndncert, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndncert authors and contributors.
- */
-
-#ifndef NDNCERT_LOGGING_HPP
-#define NDNCERT_LOGGING_HPP
-
-#include <ndn-cxx/util/logger.hpp>
-
-namespace ndn {
-namespace ndncert {
-
-#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)
-
-} // ndncert
-} // ndn
-
-#endif // NDNCERT_LOGGING_HPP
diff --git a/src/ndncert-common.hpp b/src/ndncert-common.hpp
index 02f24ff..7306084 100644
--- a/src/ndncert-common.hpp
+++ b/src/ndncert-common.hpp
@@ -46,6 +46,7 @@
#include <ndn-cxx/name.hpp>
#include <ndn-cxx/security/key-chain.hpp>
#include <ndn-cxx/security/v2/certificate.hpp>
+#include <ndn-cxx/util/logger.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/assert.hpp>
#include <boost/noncopyable.hpp>
@@ -72,6 +73,11 @@
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.cpp b/src/protocol-detail/new.cpp
index 05c7f5c..243865a 100644
--- a/src/protocol-detail/new.cpp
+++ b/src/protocol-detail/new.cpp
@@ -19,9 +19,7 @@
*/
#include "new.hpp"
-#include "../logging.hpp"
#include "../ndncert-common.hpp"
-
#include <ndn-cxx/security/transform/base64-encode.hpp>
#include <ndn-cxx/security/transform/buffer-source.hpp>
#include <ndn-cxx/security/transform/stream-sink.hpp>
diff --git a/src/protocol-detail/probe.cpp b/src/protocol-detail/probe.cpp
index aa7755f..34b769e 100644
--- a/src/protocol-detail/probe.cpp
+++ b/src/protocol-detail/probe.cpp
@@ -19,7 +19,6 @@
*/
#include "probe.hpp"
-#include "../logging.hpp"
#include <ndn-cxx/encoding/tlv.hpp>
#include <boost/throw_exception.hpp>
diff --git a/src/protocol-detail/revoke.cpp b/src/protocol-detail/revoke.cpp
index b31ae55..f8e3142 100644
--- a/src/protocol-detail/revoke.cpp
+++ b/src/protocol-detail/revoke.cpp
@@ -19,9 +19,7 @@
*/
#include "revoke.hpp"
-#include "../logging.hpp"
#include "../ndncert-common.hpp"
-
#include <ndn-cxx/security/transform/base64-encode.hpp>
#include <ndn-cxx/security/transform/buffer-source.hpp>
#include <ndn-cxx/security/transform/stream-sink.hpp>