core: reimplement logging using ndn-cxx's facility
Change-Id: Ifc7c5d70a61ad405dc1f1adfa522a2c0ad1586ab
Refs: #4580
diff --git a/daemon/table/cs-policy.cpp b/daemon/table/cs-policy.cpp
index 4aab572..a982590 100644
--- a/daemon/table/cs-policy.cpp
+++ b/daemon/table/cs-policy.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,10 +26,11 @@
#include "cs-policy.hpp"
#include "cs.hpp"
#include "core/logger.hpp"
+
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
-NFD_LOG_INIT("CsPolicy");
+NFD_LOG_INIT(CsPolicy);
namespace nfd {
namespace cs {
diff --git a/daemon/table/cs.cpp b/daemon/table/cs.cpp
index c789567..00dc9ee 100644
--- a/daemon/table/cs.cpp
+++ b/daemon/table/cs.cpp
@@ -35,7 +35,7 @@
NDN_CXX_ASSERT_FORWARD_ITERATOR(Cs::const_iterator);
-NFD_LOG_INIT("ContentStore");
+NFD_LOG_INIT(ContentStore);
unique_ptr<Policy>
makeDefaultPolicy()
diff --git a/daemon/table/dead-nonce-list.cpp b/daemon/table/dead-nonce-list.cpp
index 5df2482..d732a90 100644
--- a/daemon/table/dead-nonce-list.cpp
+++ b/daemon/table/dead-nonce-list.cpp
@@ -1,12 +1,12 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
+/*
+ * Copyright (c) 2014-2018, Regents of the University of California,
+ * Arizona Board of Regents,
+ * Colorado State University,
+ * University Pierre & Marie Curie, Sorbonne University,
+ * Washington University in St. Louis,
+ * Beijing Institute of Technology,
+ * The University of Memphis.
*
* This file is part of NFD (Named Data Networking Forwarding Daemon).
* See AUTHORS.md for complete list of NFD authors and contributors.
@@ -27,10 +27,10 @@
#include "core/city-hash.hpp"
#include "core/logger.hpp"
-NFD_LOG_INIT("DeadNonceList");
-
namespace nfd {
+NFD_LOG_INIT(DeadNonceList);
+
const time::nanoseconds DeadNonceList::DEFAULT_LIFETIME = time::seconds(6);
const time::nanoseconds DeadNonceList::MIN_LIFETIME = time::milliseconds(1);
const size_t DeadNonceList::INITIAL_CAPACITY = (1 << 7);
diff --git a/daemon/table/name-tree-hashtable.cpp b/daemon/table/name-tree-hashtable.cpp
index e6b3c33..2e25223 100644
--- a/daemon/table/name-tree-hashtable.cpp
+++ b/daemon/table/name-tree-hashtable.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -24,13 +24,13 @@
*/
#include "name-tree-hashtable.hpp"
-#include "core/logger.hpp"
#include "core/city-hash.hpp"
+#include "core/logger.hpp"
namespace nfd {
namespace name_tree {
-NFD_LOG_INIT("NameTreeHashtable");
+NFD_LOG_INIT(NameTreeHashtable);
class Hash32
{
diff --git a/daemon/table/name-tree-iterator.cpp b/daemon/table/name-tree-iterator.cpp
index 9752ac7..56c0360 100644
--- a/daemon/table/name-tree-iterator.cpp
+++ b/daemon/table/name-tree-iterator.cpp
@@ -36,7 +36,7 @@
NDN_CXX_ASSERT_FORWARD_ITERATOR(Iterator);
BOOST_CONCEPT_ASSERT((boost::ForwardRangeConcept<Range>));
-NFD_LOG_INIT("NameTreeIterator");
+NFD_LOG_INIT(NameTreeIterator);
Iterator::Iterator()
: m_entry(nullptr)
diff --git a/daemon/table/name-tree.cpp b/daemon/table/name-tree.cpp
index 02553cb..93bed3a 100644
--- a/daemon/table/name-tree.cpp
+++ b/daemon/table/name-tree.cpp
@@ -33,7 +33,7 @@
namespace nfd {
namespace name_tree {
-NFD_LOG_INIT("NameTree");
+NFD_LOG_INIT(NameTree);
NameTree::NameTree(size_t nBuckets)
: m_ht(HashtableOptions(nBuckets))
diff --git a/daemon/table/strategy-choice-entry.cpp b/daemon/table/strategy-choice-entry.cpp
index 8a73c5d..77302f7 100644
--- a/daemon/table/strategy-choice-entry.cpp
+++ b/daemon/table/strategy-choice-entry.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -24,7 +24,6 @@
*/
#include "strategy-choice-entry.hpp"
-#include "core/logger.hpp"
#include "fw/strategy.hpp"
namespace nfd {
diff --git a/daemon/table/strategy-choice.cpp b/daemon/table/strategy-choice.cpp
index 8e026dc..233f367 100644
--- a/daemon/table/strategy-choice.cpp
+++ b/daemon/table/strategy-choice.cpp
@@ -24,6 +24,7 @@
*/
#include "strategy-choice.hpp"
+
#include "measurements-entry.hpp"
#include "pit-entry.hpp"
#include "core/logger.hpp"
@@ -36,7 +37,7 @@
NDN_CXX_ASSERT_FORWARD_ITERATOR(StrategyChoice::const_iterator);
-NFD_LOG_INIT("StrategyChoice");
+NFD_LOG_INIT(StrategyChoice);
using fw::Strategy;