Make use of logger provided by ndn-cxx
This commit also introduces a basic implmentation of DummyForwarder to
remove dependency on (and uncertainty of) the running instance of NFD.
Change-Id: Iba9fcbf3d3ebb1a5ae47018ad3be5d7d2b9c7462
diff --git a/src/action-log.cpp b/src/action-log.cpp
index f6663ae..179be79 100644
--- a/src/action-log.cpp
+++ b/src/action-log.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2016, Regents of the University of California.
+ * Copyright (c) 2013-2017, Regents of the University of California.
*
* This file is part of ChronoShare, a decentralized file sharing application over NDN.
*
@@ -27,7 +27,7 @@
using namespace std;
using namespace Ndnx;
-INIT_LOGGER("ActionLog");
+_LOG_INIT(ActionLog);
const std::string INIT_DATABASE = "\
CREATE TABLE ActionLog ( \n\
diff --git a/src/content-server.cpp b/src/content-server.cpp
index bbd9235..b795afe 100644
--- a/src/content-server.cpp
+++ b/src/content-server.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2016, Regents of the University of California.
+ * Copyright (c) 2013-2017, Regents of the University of California.
*
* This file is part of ChronoShare, a decentralized file sharing application over NDN.
*
@@ -27,7 +27,7 @@
#include <boost/make_shared.hpp>
#include <utility>
-INIT_LOGGER("ContentServer");
+_LOG_INIT(ContentServer);
using namespace Ndnx;
using namespace std;
diff --git a/src/db-helper.cpp b/src/db-helper.cpp
index 0597c12..2096138 100644
--- a/src/db-helper.cpp
+++ b/src/db-helper.cpp
@@ -26,7 +26,7 @@
namespace ndn {
namespace chronoshare {
-INIT_LOGGER("DbHelper")
+_LOG_INIT(DbHelper);
namespace fs = boost::filesystem;
diff --git a/src/dispatcher.cpp b/src/dispatcher.cpp
index 4a07b14..be7d3c4 100644
--- a/src/dispatcher.cpp
+++ b/src/dispatcher.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2016, Regents of the University of California.
+ * Copyright (c) 2013-2017, Regents of the University of California.
*
* This file is part of ChronoShare, a decentralized file sharing application over NDN.
*
@@ -30,7 +30,7 @@
using namespace std;
using namespace boost;
-INIT_LOGGER("Dispatcher");
+_LOG_INIT(Dispatcher);
static const string CHRONOSHARE_APP = "chronoshare";
static const string BROADCAST_DOMAIN = "/ndn/broadcast";
diff --git a/src/fetch-manager.cpp b/src/fetch-manager.cpp
index 27f8d6d..15ecb32 100644
--- a/src/fetch-manager.cpp
+++ b/src/fetch-manager.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2016, Regents of the University of California.
+ * Copyright (c) 2013-2017, Regents of the University of California.
*
* This file is part of ChronoShare, a decentralized file sharing application over NDN.
*
@@ -27,7 +27,7 @@
#include "logging.hpp"
#include "simple-interval-generator.hpp"
-INIT_LOGGER("FetchManager");
+_LOG_INIT(FetchManager);
using namespace boost;
using namespace std;
diff --git a/src/fetcher.cpp b/src/fetcher.cpp
index e2ee6d0..83f8491 100644
--- a/src/fetcher.cpp
+++ b/src/fetcher.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2016, Regents of the University of California.
+ * Copyright (c) 2013-2017, Regents of the University of California.
*
* This file is part of ChronoShare, a decentralized file sharing application over NDN.
*
@@ -28,7 +28,7 @@
#include <boost/ref.hpp>
#include <boost/throw_exception.hpp>
-INIT_LOGGER("Fetcher");
+_LOG_INIT(Fetcher);
using namespace boost;
using namespace std;
diff --git a/src/file-state.cpp b/src/file-state.cpp
index 42e40de..33a4384 100644
--- a/src/file-state.cpp
+++ b/src/file-state.cpp
@@ -22,7 +22,7 @@
#include "logging.h"
#include <boost/bind.hpp>
-INIT_LOGGER("FileState")
+_LOG_INIT(FileState);
using namespace boost;
using namespace std;
diff --git a/src/object-db.cpp b/src/object-db.cpp
index fd4223e..e522b51 100644
--- a/src/object-db.cpp
+++ b/src/object-db.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2016, Regents of the University of California.
+ * Copyright (c) 2013-2017, Regents of the University of California.
*
* This file is part of ChronoShare, a decentralized file sharing application over NDN.
*
@@ -25,7 +25,7 @@
#include <iostream>
#include <sys/stat.h>
-INIT_LOGGER("Object.Db");
+_LOG_INIT(Object.Db);
using namespace std;
using namespace Ndnx;
diff --git a/src/object-manager.cpp b/src/object-manager.cpp
index ba3e5f2..d900098 100644
--- a/src/object-manager.cpp
+++ b/src/object-manager.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2016, Regents of the University of California.
+ * Copyright (c) 2013-2017, Regents of the University of California.
*
* This file is part of ChronoShare, a decentralized file sharing application over NDN.
*
@@ -32,7 +32,7 @@
#include <boost/throw_exception.hpp>
#include <fstream>
-INIT_LOGGER("Object.Manager");
+_LOG_INIT(Object.Manager);
using namespace Ndnx;
using namespace boost;
diff --git a/src/state-server.cpp b/src/state-server.cpp
index a013534..f84cdea 100644
--- a/src/state-server.cpp
+++ b/src/state-server.cpp
@@ -28,7 +28,7 @@
#include <boost/make_shared.hpp>
#include <utility>
-INIT_LOGGER("StateServer")
+_LOG_INIT(StateServer);
using namespace Ndnx;
using namespace std;
diff --git a/src/sync-core.cpp b/src/sync-core.cpp
index c4f9a26..f894746 100644
--- a/src/sync-core.cpp
+++ b/src/sync-core.cpp
@@ -29,7 +29,7 @@
namespace ndn {
namespace chronoshare {
-INIT_LOGGER("Sync.Core")
+_LOG_INIT(Sync.Core);
const int SyncCore::FRESHNESS = 2;
const std::string SyncCore::RECOVER = "RECOVER";
diff --git a/src/sync-log.cpp b/src/sync-log.cpp
index 4e5403d..6dde05c 100644
--- a/src/sync-log.cpp
+++ b/src/sync-log.cpp
@@ -29,7 +29,7 @@
using util::Sqlite3Statement;
-INIT_LOGGER("Sync.Log")
+_LOG_INIT(Sync.Log);
// static void
// xTrace(void*, const char* q)
@@ -101,7 +101,7 @@
, m_localName(localName)
{
sqlite3_exec(m_db, INIT_DATABASE.c_str(), NULL, NULL, NULL);
- _LOG_DEBUG_COND(sqlite3_errcode(m_db) != SQLITE_OK, "DB Constructer: " << sqlite3_errmsg(m_db));
+ _LOG_DEBUG_COND(sqlite3_errcode(m_db) != SQLITE_OK, "DB Constructor: " << sqlite3_errmsg(m_db));
UpdateDeviceSeqNo(localName, 0);