core: reimplement logging using ndn-cxx's facility
Change-Id: Ifc7c5d70a61ad405dc1f1adfa522a2c0ad1586ab
Refs: #4580
diff --git a/daemon/face/datagram-transport.hpp b/daemon/face/datagram-transport.hpp
index 2b2cc29..0b375ad 100644
--- a/daemon/face/datagram-transport.hpp
+++ b/daemon/face/datagram-transport.hpp
@@ -95,7 +95,7 @@
typename protocol::socket m_socket;
typename protocol::endpoint m_sender;
- NFD_LOG_INCLASS_DECLARE();
+ NFD_LOG_MEMBER_DECL();
private:
std::array<uint8_t, ndn::MAX_NDN_PACKET_SIZE> m_receiveBuffer;
diff --git a/daemon/face/ethernet-channel.cpp b/daemon/face/ethernet-channel.cpp
index cf60527..3791d44 100644
--- a/daemon/face/ethernet-channel.cpp
+++ b/daemon/face/ethernet-channel.cpp
@@ -35,7 +35,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INIT("EthernetChannel");
+NFD_LOG_INIT(EthernetChannel);
EthernetChannel::EthernetChannel(shared_ptr<const ndn::net::NetworkInterface> localEndpoint,
time::nanoseconds idleTimeout)
diff --git a/daemon/face/ethernet-factory.cpp b/daemon/face/ethernet-factory.cpp
index 2c6c39c..d921855 100644
--- a/daemon/face/ethernet-factory.cpp
+++ b/daemon/face/ethernet-factory.cpp
@@ -33,7 +33,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INIT("EthernetFactory");
+NFD_LOG_INIT(EthernetFactory);
NFD_REGISTER_PROTOCOL_FACTORY(EthernetFactory);
const std::string&
diff --git a/daemon/face/ethernet-transport.cpp b/daemon/face/ethernet-transport.cpp
index 5a8f91a..a7e8907 100644
--- a/daemon/face/ethernet-transport.cpp
+++ b/daemon/face/ethernet-transport.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,
@@ -35,7 +35,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INIT("EthernetTransport");
+NFD_LOG_INIT(EthernetTransport);
EthernetTransport::EthernetTransport(const ndn::net::NetworkInterface& localEndpoint,
const ethernet::Address& remoteEndpoint)
diff --git a/daemon/face/face-system.cpp b/daemon/face/face-system.cpp
index ebdce9c..1d2db37 100644
--- a/daemon/face/face-system.cpp
+++ b/daemon/face/face-system.cpp
@@ -31,7 +31,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INIT("FaceSystem");
+NFD_LOG_INIT(FaceSystem);
FaceSystem::FaceSystem(FaceTable& faceTable, shared_ptr<ndn::net::NetworkMonitor> netmon)
: m_faceTable(faceTable)
diff --git a/daemon/face/generic-link-service.cpp b/daemon/face/generic-link-service.cpp
index d7ebc7c..5122755 100644
--- a/daemon/face/generic-link-service.cpp
+++ b/daemon/face/generic-link-service.cpp
@@ -32,7 +32,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INIT("GenericLinkService");
+NFD_LOG_INIT(GenericLinkService);
constexpr uint32_t DEFAULT_CONGESTION_THRESHOLD_DIVISOR = 2;
diff --git a/daemon/face/internal-transport.cpp b/daemon/face/internal-transport.cpp
index 5b82c20..7e7ac3e 100644
--- a/daemon/face/internal-transport.cpp
+++ b/daemon/face/internal-transport.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,
@@ -29,11 +29,11 @@
namespace nfd {
namespace face {
-NFD_LOG_INCLASS_DEFINE(InternalForwarderTransport, "InternalForwarderTransport");
+NFD_LOG_MEMBER_INIT(InternalForwarderTransport, InternalForwarderTransport);
+NFD_LOG_MEMBER_INIT(InternalClientTransport, InternalClientTransport);
-InternalForwarderTransport::InternalForwarderTransport(
- const FaceUri& localUri, const FaceUri& remoteUri,
- ndn::nfd::FaceScope scope, ndn::nfd::LinkType linkType)
+InternalForwarderTransport::InternalForwarderTransport(const FaceUri& localUri, const FaceUri& remoteUri,
+ ndn::nfd::FaceScope scope, ndn::nfd::LinkType linkType)
{
this->setLocalUri(localUri);
this->setRemoteUri(remoteUri);
@@ -71,8 +71,6 @@
this->setState(TransportState::CLOSED);
}
-NFD_LOG_INCLASS_DEFINE(InternalClientTransport, "InternalClientTransport");
-
static void
asyncReceive(InternalTransportBase* recipient, const Block& packet)
{
diff --git a/daemon/face/internal-transport.hpp b/daemon/face/internal-transport.hpp
index 67a53b3..9f834d7 100644
--- a/daemon/face/internal-transport.hpp
+++ b/daemon/face/internal-transport.hpp
@@ -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,
@@ -27,6 +27,7 @@
#define NFD_DAEMON_FACE_INTERNAL_TRANSPORT_HPP
#include "transport.hpp"
+
#include <ndn-cxx/transport/transport.hpp>
namespace nfd {
@@ -73,7 +74,7 @@
doSend(Packet&& packet) override;
private:
- NFD_LOG_INCLASS_DECLARE();
+ NFD_LOG_MEMBER_DECL();
};
/** \brief implements a client-side transport that can be paired with another
@@ -117,7 +118,7 @@
send(const Block& header, const Block& payload) override;
private:
- NFD_LOG_INCLASS_DECLARE();
+ NFD_LOG_MEMBER_DECL();
signal::ScopedConnection m_fwToClientTransmitConn;
signal::ScopedConnection m_clientToFwTransmitConn;
diff --git a/daemon/face/link-service.cpp b/daemon/face/link-service.cpp
index 9b05c2a..c5dcdfc 100644
--- a/daemon/face/link-service.cpp
+++ b/daemon/face/link-service.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,
@@ -29,7 +29,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INIT("LinkService");
+NFD_LOG_INIT(LinkService);
LinkService::LinkService()
: m_face(nullptr)
diff --git a/daemon/face/lp-fragmenter.cpp b/daemon/face/lp-fragmenter.cpp
index b54f7d5..1928bf5 100644
--- a/daemon/face/lp-fragmenter.cpp
+++ b/daemon/face/lp-fragmenter.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015, 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,
@@ -25,12 +25,13 @@
#include "lp-fragmenter.hpp"
#include "link-service.hpp"
+
#include <ndn-cxx/encoding/tlv.hpp>
namespace nfd {
namespace face {
-NFD_LOG_INIT("LpFragmenter");
+NFD_LOG_INIT(LpFragmenter);
static_assert(lp::tlv::LpPacket < 253, "LpPacket TLV-TYPE must fit in 1 octet");
static_assert(lp::tlv::Sequence < 253, "Sequence TLV-TYPE must fit in 1 octet");
diff --git a/daemon/face/lp-fragmenter.hpp b/daemon/face/lp-fragmenter.hpp
index 8275d0f..40d32cb 100644
--- a/daemon/face/lp-fragmenter.hpp
+++ b/daemon/face/lp-fragmenter.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015, 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,6 +26,7 @@
#ifndef NFD_DAEMON_FACE_LP_FRAGMENTER_HPP
#define NFD_DAEMON_FACE_LP_FRAGMENTER_HPP
+#include "core/common.hpp"
#include "face-log.hpp"
#include <ndn-cxx/lp/packet.hpp>
@@ -36,7 +37,7 @@
class LinkService;
/** \brief fragments network-layer packets into NDNLPv2 link-layer packets
- * \sa http://redmine.named-data.net/projects/nfd/wiki/NDNLPv2
+ * \sa https://redmine.named-data.net/projects/nfd/wiki/NDNLPv2
*/
class LpFragmenter
{
diff --git a/daemon/face/lp-reassembler.cpp b/daemon/face/lp-reassembler.cpp
index 88ef1c1..a6d1c60 100644
--- a/daemon/face/lp-reassembler.cpp
+++ b/daemon/face/lp-reassembler.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015, 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,
@@ -25,12 +25,13 @@
#include "lp-reassembler.hpp"
#include "link-service.hpp"
+
#include <numeric>
namespace nfd {
namespace face {
-NFD_LOG_INIT("LpReassembler");
+NFD_LOG_INIT(LpReassembler);
LpReassembler::Options::Options()
: nMaxFragments(400)
diff --git a/daemon/face/multicast-ethernet-transport.cpp b/daemon/face/multicast-ethernet-transport.cpp
index b7bbdc2..91c25d4 100644
--- a/daemon/face/multicast-ethernet-transport.cpp
+++ b/daemon/face/multicast-ethernet-transport.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,
@@ -46,7 +46,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INIT("MulticastEthernetTransport");
+NFD_LOG_INIT(MulticastEthernetTransport);
MulticastEthernetTransport::MulticastEthernetTransport(const ndn::net::NetworkInterface& localEndpoint,
const ethernet::Address& mcastAddress,
diff --git a/daemon/face/multicast-udp-transport.cpp b/daemon/face/multicast-udp-transport.cpp
index 80f86ae..3574158 100644
--- a/daemon/face/multicast-udp-transport.cpp
+++ b/daemon/face/multicast-udp-transport.cpp
@@ -40,8 +40,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INCLASS_2TEMPLATE_SPECIALIZATION_DEFINE(DatagramTransport, MulticastUdpTransport::protocol,
- Multicast, "MulticastUdpTransport");
+NFD_LOG_MEMBER_INIT_SPECIALIZED((DatagramTransport<boost::asio::ip::udp, Multicast>), MulticastUdpTransport);
MulticastUdpTransport::MulticastUdpTransport(const protocol::endpoint& multicastGroup,
protocol::socket&& recvSocket,
diff --git a/daemon/face/multicast-udp-transport.hpp b/daemon/face/multicast-udp-transport.hpp
index ba7bcbe..72498d0 100644
--- a/daemon/face/multicast-udp-transport.hpp
+++ b/daemon/face/multicast-udp-transport.hpp
@@ -33,6 +33,8 @@
namespace nfd {
namespace face {
+NFD_LOG_MEMBER_DECL_SPECIALIZED((DatagramTransport<boost::asio::ip::udp, Multicast>));
+
// Explicit specialization of makeEndpointId for the UDP multicast case.
// Note that this "shall be declared before the first use of the specialization
// that would cause an implicit instantiation to take place, in every translation
diff --git a/daemon/face/stream-transport.hpp b/daemon/face/stream-transport.hpp
index 0adbf26..d70e4f6 100644
--- a/daemon/face/stream-transport.hpp
+++ b/daemon/face/stream-transport.hpp
@@ -97,7 +97,7 @@
protected:
typename protocol::socket m_socket;
- NFD_LOG_INCLASS_DECLARE();
+ NFD_LOG_MEMBER_DECL();
private:
uint8_t m_receiveBuffer[ndn::MAX_NDN_PACKET_SIZE];
diff --git a/daemon/face/tcp-channel.cpp b/daemon/face/tcp-channel.cpp
index 058bbe5..968c6a7 100644
--- a/daemon/face/tcp-channel.cpp
+++ b/daemon/face/tcp-channel.cpp
@@ -31,7 +31,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INIT("TcpChannel");
+NFD_LOG_INIT(TcpChannel);
namespace ip = boost::asio::ip;
diff --git a/daemon/face/tcp-factory.cpp b/daemon/face/tcp-factory.cpp
index 1831467..02d5f33 100644
--- a/daemon/face/tcp-factory.cpp
+++ b/daemon/face/tcp-factory.cpp
@@ -32,7 +32,7 @@
namespace ip = boost::asio::ip;
-NFD_LOG_INIT("TcpFactory");
+NFD_LOG_INIT(TcpFactory);
NFD_REGISTER_PROTOCOL_FACTORY(TcpFactory);
const std::string&
diff --git a/daemon/face/tcp-transport.cpp b/daemon/face/tcp-transport.cpp
index eef8570..ad1be5d 100644
--- a/daemon/face/tcp-transport.cpp
+++ b/daemon/face/tcp-transport.cpp
@@ -33,7 +33,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(StreamTransport, TcpTransport::protocol, "TcpTransport");
+NFD_LOG_MEMBER_INIT_SPECIALIZED(StreamTransport<boost::asio::ip::tcp>, TcpTransport);
time::milliseconds TcpTransport::s_initialReconnectWait = time::seconds(1);
time::milliseconds TcpTransport::s_maxReconnectWait = time::minutes(5);
diff --git a/daemon/face/tcp-transport.hpp b/daemon/face/tcp-transport.hpp
index 9367ffe..adf5085 100644
--- a/daemon/face/tcp-transport.hpp
+++ b/daemon/face/tcp-transport.hpp
@@ -32,6 +32,8 @@
namespace nfd {
namespace face {
+NFD_LOG_MEMBER_DECL_SPECIALIZED(StreamTransport<boost::asio::ip::tcp>);
+
/**
* \brief A Transport that communicates on a connected TCP socket
*
diff --git a/daemon/face/transport.cpp b/daemon/face/transport.cpp
index 863b2b3..f615a10 100644
--- a/daemon/face/transport.cpp
+++ b/daemon/face/transport.cpp
@@ -29,7 +29,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INIT("Transport");
+NFD_LOG_INIT(Transport);
std::ostream&
operator<<(std::ostream& os, TransportState state)
diff --git a/daemon/face/udp-channel.cpp b/daemon/face/udp-channel.cpp
index 209aa70..3d6e6b8 100644
--- a/daemon/face/udp-channel.cpp
+++ b/daemon/face/udp-channel.cpp
@@ -31,7 +31,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INIT("UdpChannel");
+NFD_LOG_INIT(UdpChannel);
namespace ip = boost::asio::ip;
diff --git a/daemon/face/udp-factory.cpp b/daemon/face/udp-factory.cpp
index 377d3b1..2b7b3c8 100644
--- a/daemon/face/udp-factory.cpp
+++ b/daemon/face/udp-factory.cpp
@@ -38,7 +38,7 @@
namespace ip = boost::asio::ip;
namespace net = ndn::net;
-NFD_LOG_INIT("UdpFactory");
+NFD_LOG_INIT(UdpFactory);
NFD_REGISTER_PROTOCOL_FACTORY(UdpFactory);
const std::string&
diff --git a/daemon/face/unicast-ethernet-transport.cpp b/daemon/face/unicast-ethernet-transport.cpp
index e2e56d0..e28fa93 100644
--- a/daemon/face/unicast-ethernet-transport.cpp
+++ b/daemon/face/unicast-ethernet-transport.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,
@@ -30,7 +30,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INIT("UnicastEthernetTransport");
+NFD_LOG_INIT(UnicastEthernetTransport);
UnicastEthernetTransport::UnicastEthernetTransport(const ndn::net::NetworkInterface& localEndpoint,
const ethernet::Address& remoteEndpoint,
diff --git a/daemon/face/unicast-udp-transport.cpp b/daemon/face/unicast-udp-transport.cpp
index 4f8a8f7..8e3d7d8 100644
--- a/daemon/face/unicast-udp-transport.cpp
+++ b/daemon/face/unicast-udp-transport.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,
@@ -36,8 +36,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(DatagramTransport, UnicastUdpTransport::protocol,
- "UnicastUdpTransport");
+NFD_LOG_MEMBER_INIT_SPECIALIZED((DatagramTransport<boost::asio::ip::udp, Unicast>), UnicastUdpTransport);
UnicastUdpTransport::UnicastUdpTransport(protocol::socket&& socket,
ndn::nfd::FacePersistency persistency,
diff --git a/daemon/face/unicast-udp-transport.hpp b/daemon/face/unicast-udp-transport.hpp
index 6136746..b1eb672 100644
--- a/daemon/face/unicast-udp-transport.hpp
+++ b/daemon/face/unicast-udp-transport.hpp
@@ -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,
@@ -32,6 +32,8 @@
namespace nfd {
namespace face {
+NFD_LOG_MEMBER_DECL_SPECIALIZED((DatagramTransport<boost::asio::ip::udp, Unicast>));
+
/**
* \brief A Transport that communicates on a unicast UDP socket
*/
diff --git a/daemon/face/unix-stream-channel.cpp b/daemon/face/unix-stream-channel.cpp
index fcc8fe7..a127c84 100644
--- a/daemon/face/unix-stream-channel.cpp
+++ b/daemon/face/unix-stream-channel.cpp
@@ -34,7 +34,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INIT("UnixStreamChannel");
+NFD_LOG_INIT(UnixStreamChannel);
UnixStreamChannel::UnixStreamChannel(const unix_stream::Endpoint& endpoint,
bool wantCongestionMarking)
diff --git a/daemon/face/unix-stream-factory.cpp b/daemon/face/unix-stream-factory.cpp
index 439eff4..2d8567a 100644
--- a/daemon/face/unix-stream-factory.cpp
+++ b/daemon/face/unix-stream-factory.cpp
@@ -30,7 +30,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INIT("UnixStreamFactory");
+NFD_LOG_INIT(UnixStreamFactory);
NFD_REGISTER_PROTOCOL_FACTORY(UnixStreamFactory);
const std::string&
diff --git a/daemon/face/unix-stream-transport.cpp b/daemon/face/unix-stream-transport.cpp
index cbbda54..b1987a5 100644
--- a/daemon/face/unix-stream-transport.cpp
+++ b/daemon/face/unix-stream-transport.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,
@@ -28,8 +28,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(StreamTransport, UnixStreamTransport::protocol,
- "UnixStreamTransport");
+NFD_LOG_MEMBER_INIT_SPECIALIZED(StreamTransport<boost::asio::local::stream_protocol>, UnixStreamTransport);
UnixStreamTransport::UnixStreamTransport(protocol::socket&& socket)
: StreamTransport(std::move(socket))
diff --git a/daemon/face/unix-stream-transport.hpp b/daemon/face/unix-stream-transport.hpp
index 510350e..a52567a 100644
--- a/daemon/face/unix-stream-transport.hpp
+++ b/daemon/face/unix-stream-transport.hpp
@@ -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,
@@ -35,6 +35,8 @@
namespace nfd {
namespace face {
+NFD_LOG_MEMBER_DECL_SPECIALIZED(StreamTransport<boost::asio::local::stream_protocol>);
+
/**
* \brief A Transport that communicates on a stream-oriented Unix domain socket
*/
diff --git a/daemon/face/websocket-channel.cpp b/daemon/face/websocket-channel.cpp
index d26a0b5..2ac9384 100644
--- a/daemon/face/websocket-channel.cpp
+++ b/daemon/face/websocket-channel.cpp
@@ -31,7 +31,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INIT("WebSocketChannel");
+NFD_LOG_INIT(WebSocketChannel);
WebSocketChannel::WebSocketChannel(const websocket::Endpoint& localEndpoint)
: m_localEndpoint(localEndpoint)
diff --git a/daemon/face/websocket-factory.cpp b/daemon/face/websocket-factory.cpp
index c61d900..11921cc 100644
--- a/daemon/face/websocket-factory.cpp
+++ b/daemon/face/websocket-factory.cpp
@@ -30,7 +30,7 @@
namespace ip = boost::asio::ip;
-NFD_LOG_INIT("WebSocketFactory");
+NFD_LOG_INIT(WebSocketFactory);
NFD_REGISTER_PROTOCOL_FACTORY(WebSocketFactory);
const std::string&
diff --git a/daemon/face/websocket-transport.cpp b/daemon/face/websocket-transport.cpp
index d4bbbac..97af039 100644
--- a/daemon/face/websocket-transport.cpp
+++ b/daemon/face/websocket-transport.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,
@@ -28,7 +28,7 @@
namespace nfd {
namespace face {
-NFD_LOG_INIT("WebSocketTransport");
+NFD_LOG_INIT(WebSocketTransport);
static bool
isLoopback(const boost::asio::ip::address& addr)
diff --git a/daemon/fw/access-strategy.cpp b/daemon/fw/access-strategy.cpp
index 377ef80..a766424 100644
--- a/daemon/fw/access-strategy.cpp
+++ b/daemon/fw/access-strategy.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,
@@ -30,7 +30,7 @@
namespace nfd {
namespace fw {
-NFD_LOG_INIT("AccessStrategy");
+NFD_LOG_INIT(AccessStrategy);
NFD_REGISTER_STRATEGY(AccessStrategy);
AccessStrategy::AccessStrategy(Forwarder& forwarder, const Name& name)
diff --git a/daemon/fw/asf-measurements.cpp b/daemon/fw/asf-measurements.cpp
index e85ec3f..0d772ac 100644
--- a/daemon/fw/asf-measurements.cpp
+++ b/daemon/fw/asf-measurements.cpp
@@ -29,7 +29,7 @@
namespace fw {
namespace asf {
-NFD_LOG_INIT("AsfMeasurements");
+NFD_LOG_INIT(AsfMeasurements);
const RttStats::Rtt RttStats::RTT_TIMEOUT(-1.0);
const RttStats::Rtt RttStats::RTT_NO_MEASUREMENT(0.0);
diff --git a/daemon/fw/asf-strategy.cpp b/daemon/fw/asf-strategy.cpp
index ab629f9..d47649d 100644
--- a/daemon/fw/asf-strategy.cpp
+++ b/daemon/fw/asf-strategy.cpp
@@ -25,14 +25,13 @@
#include "asf-strategy.hpp"
#include "algorithm.hpp"
-
#include "core/logger.hpp"
namespace nfd {
namespace fw {
namespace asf {
-NFD_LOG_INIT("AsfStrategy");
+NFD_LOG_INIT(AsfStrategy);
NFD_REGISTER_STRATEGY(AsfStrategy);
const time::milliseconds AsfStrategy::RETX_SUPPRESSION_INITIAL(10);
diff --git a/daemon/fw/best-route-strategy2.cpp b/daemon/fw/best-route-strategy2.cpp
index 61dc07a..2956ed7 100644
--- a/daemon/fw/best-route-strategy2.cpp
+++ b/daemon/fw/best-route-strategy2.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,
@@ -30,7 +30,7 @@
namespace nfd {
namespace fw {
-NFD_LOG_INIT("BestRouteStrategy2");
+NFD_LOG_INIT(BestRouteStrategy2);
NFD_REGISTER_STRATEGY(BestRouteStrategy2);
const time::milliseconds BestRouteStrategy2::RETX_SUPPRESSION_INITIAL(10);
diff --git a/daemon/fw/client-control-strategy.cpp b/daemon/fw/client-control-strategy.cpp
index 1de5a58..f381c04 100644
--- a/daemon/fw/client-control-strategy.cpp
+++ b/daemon/fw/client-control-strategy.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,
@@ -29,7 +29,7 @@
namespace nfd {
namespace fw {
-NFD_LOG_INIT("ClientControlStrategy");
+NFD_LOG_INIT(ClientControlStrategy);
NFD_REGISTER_STRATEGY(ClientControlStrategy);
ClientControlStrategy::ClientControlStrategy(Forwarder& forwarder, const Name& name)
diff --git a/daemon/fw/face-table.cpp b/daemon/fw/face-table.cpp
index fbd90f0..3e19dd1 100644
--- a/daemon/fw/face-table.cpp
+++ b/daemon/fw/face-table.cpp
@@ -34,7 +34,7 @@
NDN_CXX_ASSERT_FORWARD_ITERATOR(FaceTable::const_iterator);
-NFD_LOG_INIT("FaceTable");
+NFD_LOG_INIT(FaceTable);
FaceTable::FaceTable()
: m_lastFaceId(face::FACEID_RESERVED_MAX)
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index f967e0b..accfb38 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -24,16 +24,18 @@
*/
#include "forwarder.hpp"
+
#include "algorithm.hpp"
#include "best-route-strategy2.hpp"
#include "strategy.hpp"
#include "core/logger.hpp"
#include "table/cleanup.hpp"
+
#include <ndn-cxx/lp/tags.hpp>
namespace nfd {
-NFD_LOG_INIT("Forwarder");
+NFD_LOG_INIT(Forwarder);
static Name
getDefaultStrategyName()
diff --git a/daemon/fw/multicast-strategy.cpp b/daemon/fw/multicast-strategy.cpp
index 297f481..6a05356 100644
--- a/daemon/fw/multicast-strategy.cpp
+++ b/daemon/fw/multicast-strategy.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,
@@ -32,7 +32,7 @@
NFD_REGISTER_STRATEGY(MulticastStrategy);
-NFD_LOG_INIT("MulticastStrategy");
+NFD_LOG_INIT(MulticastStrategy);
const time::milliseconds MulticastStrategy::RETX_SUPPRESSION_INITIAL(10);
const time::milliseconds MulticastStrategy::RETX_SUPPRESSION_MAX(250);
diff --git a/daemon/fw/process-nack-traits.cpp b/daemon/fw/process-nack-traits.cpp
index cd1f00e..584bf70 100644
--- a/daemon/fw/process-nack-traits.cpp
+++ b/daemon/fw/process-nack-traits.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,
@@ -29,7 +29,7 @@
namespace nfd {
namespace fw {
-NFD_LOG_INIT("ProcessNackTraits");
+NFD_LOG_INIT(ProcessNackTraits);
void
ProcessNackTraitsBase::processNack(const Face& inFace, const lp::Nack& nack,
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index 278e016..4dfe32e 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -27,13 +27,14 @@
#include "forwarder.hpp"
#include "core/logger.hpp"
#include "core/random.hpp"
+
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
namespace nfd {
namespace fw {
-NFD_LOG_INIT("Strategy");
+NFD_LOG_INIT(Strategy);
Strategy::Registry&
Strategy::getRegistry()
diff --git a/daemon/main.cpp b/daemon/main.cpp
index c549ac9..0de725e 100644
--- a/daemon/main.cpp
+++ b/daemon/main.cpp
@@ -29,11 +29,10 @@
#include "core/extended-error-message.hpp"
#include "core/global-io.hpp"
#include "core/logger.hpp"
-#include "core/logger-factory.hpp"
#include "core/privilege-helper.hpp"
#include "core/version.hpp"
-#include <string.h>
+#include <string.h> // for strsignal()
#include <boost/config.hpp>
#include <boost/filesystem.hpp>
@@ -49,7 +48,9 @@
#include <condition_variable>
#include <iostream>
+#include <ndn-cxx/util/logging.hpp>
#include <ndn-cxx/version.hpp>
+
#ifdef HAVE_LIBPCAP
#include <pcap/pcap.h>
#endif
@@ -59,7 +60,7 @@
namespace po = boost::program_options;
-NFD_LOG_INIT("Main");
+NFD_LOG_INIT(Main);
namespace nfd {
@@ -205,10 +206,10 @@
};
static void
-printUsage(std::ostream& os, const char* programName,
- const po::options_description& opts)
+printUsage(std::ostream& os, const char* programName, const po::options_description& opts)
{
os << "Usage: " << programName << " [options]\n"
+ << "\n"
<< "Run the NDN Forwarding Daemon (NFD)\n"
<< "\n"
<< opts;
@@ -217,10 +218,9 @@
static void
printLogModules(std::ostream& os)
{
- const auto& factory = LoggerFactory::getInstance();
- for (const auto& module : factory.getModules()) {
- os << module << "\n";
- }
+ const auto& modules = ndn::util::Logging::getLoggerNames();
+ std::copy(modules.begin(), modules.end(), ndn::make_ostream_joiner(os, "\n"));
+ os << std::endl;
}
} // namespace nfd
@@ -247,8 +247,9 @@
po::notify(vm);
}
catch (const std::exception& e) {
- // avoid NFD_LOG_FATAL to ensure that errors related to command-line parsing always appear on the
- // terminal and are not littered with timestamps and other things added by the logging subsystem
+ // Cannot use NFD_LOG_* macros here, because the logging subsystem is not initialized yet
+ // at this point. Moreover, we don't want to clutter error messages related to command-line
+ // parsing with timestamps and other useless text added by the macros.
std::cerr << "ERROR: " << e.what() << "\n\n";
printUsage(std::cerr, argv[0], description);
return 2;
@@ -288,13 +289,13 @@
"without WebSocket++";
#endif
- NFD_LOG_INFO("NFD version " NFD_VERSION_BUILD_STRING " starting");
- NFD_LOG_INFO("Built with " BOOST_COMPILER
- ", with " BOOST_STDLIB
+ std::clog << "NFD version " NFD_VERSION_BUILD_STRING " starting\n"
+ << "Built with " BOOST_COMPILER ", with " BOOST_STDLIB
", " << boostBuildInfo <<
", " << pcapBuildInfo <<
", " << wsBuildInfo <<
- ", with ndn-cxx version " NDN_CXX_VERSION_BUILD_STRING);
+ ", with ndn-cxx version " NDN_CXX_VERSION_BUILD_STRING
+ << std::endl;
NfdRunner runner(configFile);
try {
diff --git a/daemon/mgmt/command-authenticator.cpp b/daemon/mgmt/command-authenticator.cpp
index 04f2476..0b6346b 100644
--- a/daemon/mgmt/command-authenticator.cpp
+++ b/daemon/mgmt/command-authenticator.cpp
@@ -41,7 +41,7 @@
namespace nfd {
-NFD_LOG_INIT("CommandAuthenticator");
+NFD_LOG_INIT(CommandAuthenticator);
// INFO: configuration change, etc
// DEBUG: per authentication request result
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index 76fac1c..1d53eab 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -24,6 +24,8 @@
*/
#include "face-manager.hpp"
+
+#include "core/logger.hpp"
#include "face/generic-link-service.hpp"
#include "face/protocol-factory.hpp"
#include "fw/face-table.hpp"
@@ -35,7 +37,7 @@
namespace nfd {
-NFD_LOG_INIT("FaceManager");
+NFD_LOG_INIT(FaceManager);
FaceManager::FaceManager(FaceSystem& faceSystem,
Dispatcher& dispatcher,
diff --git a/daemon/mgmt/fib-manager.cpp b/daemon/mgmt/fib-manager.cpp
index 06e660a..5c04977 100644
--- a/daemon/mgmt/fib-manager.cpp
+++ b/daemon/mgmt/fib-manager.cpp
@@ -24,6 +24,8 @@
*/
#include "fib-manager.hpp"
+
+#include "core/logger.hpp"
#include "fw/face-table.hpp"
#include <ndn-cxx/lp/tags.hpp>
@@ -33,7 +35,7 @@
namespace nfd {
-NFD_LOG_INIT("FibManager");
+NFD_LOG_INIT(FibManager);
FibManager::FibManager(Fib& fib,
const FaceTable& faceTable,
diff --git a/daemon/mgmt/fib-manager.hpp b/daemon/mgmt/fib-manager.hpp
index b5c6984..c5455e9 100644
--- a/daemon/mgmt/fib-manager.hpp
+++ b/daemon/mgmt/fib-manager.hpp
@@ -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,
@@ -27,9 +27,8 @@
#define NFD_DAEMON_MGMT_FIB_MANAGER_HPP
#include "nfd-manager-base.hpp"
-#include "core/logger.hpp"
-#include "table/fib.hpp"
#include "fw/forwarder.hpp"
+#include "table/fib.hpp"
namespace nfd {
@@ -37,7 +36,7 @@
/**
* @brief implement the FIB Management of NFD Management Protocol.
- * @sa http://redmine.named-data.net/projects/nfd/wiki/FibMgmt
+ * @sa https://redmine.named-data.net/projects/nfd/wiki/FibMgmt
*/
class FibManager : public NfdManagerBase
{
diff --git a/daemon/mgmt/general-config-section.cpp b/daemon/mgmt/general-config-section.cpp
index 2b573b3..6ed3af1 100644
--- a/daemon/mgmt/general-config-section.cpp
+++ b/daemon/mgmt/general-config-section.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,83 +24,58 @@
*/
#include "general-config-section.hpp"
-
-#include "core/logger.hpp"
#include "core/privilege-helper.hpp"
-#include "core/config-file.hpp"
namespace nfd {
-
namespace general {
-NFD_LOG_INIT("GeneralConfigSection");
-
static void
-onConfig(const ConfigSection& configSection,
- bool isDryRun,
- const std::string& filename)
+onConfig(const ConfigSection& section, bool isDryRun, const std::string&)
{
// general
// {
- // ; user "ndn-user"
- // ; group "ndn-user"
+ // user "ndn-user"
+ // group "ndn-user"
// }
std::string user;
std::string group;
- for (ConfigSection::const_iterator i = configSection.begin();
- i != configSection.end();
- ++i)
- {
- if (i->first == "user")
- {
- try
- {
- user = i->second.get_value<std::string>("user");
+ for (const auto& i : section) {
+ if (i.first == "user") {
+ try {
+ user = i.second.get_value<std::string>("user");
- if (user.empty())
- {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"user\""
- " in \"general\" section"));
- }
- }
- catch (const boost::property_tree::ptree_error& error)
- {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"user\""
- " in \"general\" section"));
- }
+ if (user.empty()) {
+ BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"user\" in \"general\" section"));
}
- else if (i->first == "group")
- {
- try
- {
- group = i->second.get_value<std::string>("group");
-
- if (group.empty())
- {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"group\""
- " in \"general\" section"));
- }
- }
- catch (const boost::property_tree::ptree_error& error)
- {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"group\""
- " in \"general\" section"));
- }
- }
+ }
+ catch (const boost::property_tree::ptree_error&) {
+ BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"user\" in \"general\" section"));
+ }
}
- NFD_LOG_TRACE("using user \"" << user << "\" group \"" << group << "\"");
+ else if (i.first == "group") {
+ try {
+ group = i.second.get_value<std::string>("group");
+
+ if (group.empty()) {
+ BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"group\" in \"general\" section"));
+ }
+ }
+ catch (const boost::property_tree::ptree_error&) {
+ BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"group\" in \"general\" section"));
+ }
+ }
+ }
PrivilegeHelper::initialize(user, group);
}
void
-setConfigFile(ConfigFile& configFile)
+setConfigFile(ConfigFile& config)
{
- configFile.addSectionHandler("general", &onConfig);
+ config.addSectionHandler("general", &onConfig);
}
} // namespace general
-
} // namespace nfd
diff --git a/daemon/mgmt/general-config-section.hpp b/daemon/mgmt/general-config-section.hpp
index 6ce5473..a70bc48 100644
--- a/daemon/mgmt/general-config-section.hpp
+++ b/daemon/mgmt/general-config-section.hpp
@@ -1,11 +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
+/*
+ * 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.
@@ -20,22 +21,20 @@
*
* You should have received a copy of the GNU General Public License along with
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#ifndef NFD_MGMT_GENERAL_CONFIG_SECTION_HPP
#define NFD_MGMT_GENERAL_CONFIG_SECTION_HPP
+#include "core/config-file.hpp"
+
namespace nfd {
-
-class ConfigFile;
-
namespace general {
void
-setConfigFile(ConfigFile& configFile);
+setConfigFile(ConfigFile& config);
} // namespace general
-
} // namespace nfd
#endif // NFD_MGMT_GENERAL_CONFIG_SECTION_HPP
diff --git a/daemon/mgmt/strategy-choice-manager.cpp b/daemon/mgmt/strategy-choice-manager.cpp
index 6cb5d57..8f7cef0 100644
--- a/daemon/mgmt/strategy-choice-manager.cpp
+++ b/daemon/mgmt/strategy-choice-manager.cpp
@@ -24,13 +24,15 @@
*/
#include "strategy-choice-manager.hpp"
+
+#include "core/logger.hpp"
#include "table/strategy-choice.hpp"
+
#include <ndn-cxx/mgmt/nfd/strategy-choice.hpp>
-#include <boost/lexical_cast.hpp>
namespace nfd {
-NFD_LOG_INIT("StrategyChoiceManager");
+NFD_LOG_INIT(StrategyChoiceManager);
StrategyChoiceManager::StrategyChoiceManager(StrategyChoice& strategyChoice,
Dispatcher& dispatcher,
diff --git a/daemon/nfd.cpp b/daemon/nfd.cpp
index 6d5a6c4..f96720f 100644
--- a/daemon/nfd.cpp
+++ b/daemon/nfd.cpp
@@ -27,7 +27,7 @@
#include "core/config-file.hpp"
#include "core/global-io.hpp"
-#include "core/logger-factory.hpp"
+#include "core/log-config-section.hpp"
#include "core/privilege-helper.hpp"
#include "face/face-system.hpp"
#include "face/internal-face.hpp"
@@ -43,7 +43,7 @@
namespace nfd {
-NFD_LOG_INIT("Nfd");
+NFD_LOG_INIT(Nfd);
static const std::string INTERNAL_CONFIG = "internal://nfd.conf";
@@ -73,7 +73,7 @@
void
Nfd::initialize()
{
- initializeLogging();
+ configureLogging();
m_forwarder = make_unique<Forwarder>();
@@ -98,10 +98,10 @@
}
void
-Nfd::initializeLogging()
+Nfd::configureLogging()
{
ConfigFile config(&ConfigFile::ignoreUnknownSection);
- LoggerFactory::getInstance().setConfigFile(config);
+ log::setConfigFile(config);
if (!m_configFile.empty()) {
config.parse(m_configFile, true);
@@ -176,12 +176,9 @@
void
Nfd::reloadConfigFile()
{
- // Logging
- initializeLogging();
+ configureLogging();
- // Other stuff
ConfigFile config(&ignoreRibAndLogSections);
-
general::setConfigFile(config);
TablesConfigSection tablesConfig(*m_forwarder);
diff --git a/daemon/nfd.hpp b/daemon/nfd.hpp
index f9f43c4..4aadc18 100644
--- a/daemon/nfd.hpp
+++ b/daemon/nfd.hpp
@@ -100,7 +100,7 @@
Nfd(ndn::KeyChain& keyChain);
void
- initializeLogging();
+ configureLogging();
void
initializeManagement();
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;