src: Removing deprecated logging facility
This commit removes last usages of logging facility and removes the
facility all together. At some point in the future we may add logging
back, but it should be something that is depends and configured from
the application.
Change-Id: I10bd94aea05f127041d68cb77a77eb96e929c880
diff --git a/src/security/sec-rule-relative.cpp b/src/security/sec-rule-relative.cpp
index 4b9b830..cc33320 100644
--- a/src/security/sec-rule-relative.cpp
+++ b/src/security/sec-rule-relative.cpp
@@ -19,10 +19,6 @@
#include "signature-sha256-with-rsa.hpp"
#include "security-common.hpp"
-#include "../util/logging.hpp"
-
-INIT_LOGGER ("ndn.SecRuleRelative");
-
using namespace std;
namespace ndn {
diff --git a/src/security/validator-regex.cpp b/src/security/validator-regex.cpp
index 4c74e79..5f92436 100644
--- a/src/security/validator-regex.cpp
+++ b/src/security/validator-regex.cpp
@@ -18,10 +18,6 @@
#include "signature-sha256-with-rsa.hpp"
#include "certificate-cache-ttl.hpp"
-#include "../util/logging.hpp"
-
-INIT_LOGGER("ndn.ValidatorRegex");
-
using namespace std;
namespace ndn {
@@ -61,7 +57,6 @@
}
else
{
- _LOG_DEBUG("Wrong validity:");
return onValidationFailed(data,
"Signing certificate " +
signCertificate->getName().toUri() +
@@ -126,7 +121,8 @@
}
else
{
- // _LOG_DEBUG("KeyLocator is not trust anchor");
+ // KeyLocator is not a trust anchor
+
OnDataValidated onKeyValidated =
bind(&ValidatorRegex::onCertificateValidated, this, _1,
data.shared_from_this(), onValidated, onValidationFailed);
diff --git a/src/util/logging.cpp b/src/util/logging.cpp
deleted file mode 100644
index d395ea0..0000000
--- a/src/util/logging.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/**
- * Copyright (c) 2013-2014, Regents of the University of California.
- * All rights reserved.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- *
- * This file licensed under New BSD License. See COPYING for detailed information about
- * ndn-cxx library copyright, permissions, and redistribution restrictions.
- *
- * @author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
- * @author Zhenkai Zhu <http://irl.cs.ucla.edu/~zhenkai/>
- */
-
-#include "common.hpp"
-
-#include "logging.hpp"
-
-#ifdef NDN_CXX_HAVE_LOG4CXX
-
-#include <log4cxx/logger.h>
-#include <log4cxx/basicconfigurator.h>
-#include <log4cxx/consoleappender.h>
-#include <log4cxx/patternlayout.h>
-#include <log4cxx/level.h>
-#include <log4cxx/propertyconfigurator.h>
-#include <log4cxx/defaultconfigurator.h>
-#include <log4cxx/helpers/exception.h>
-using namespace log4cxx;
-using namespace log4cxx::helpers;
-
-#include <unistd.h>
-
-void
-INIT_LOGGERS()
-{
- static bool configured = false;
-
- if (configured) return;
-
- if (access("log4cxx.properties", R_OK)==0)
- PropertyConfigurator::configureAndWatch("log4cxx.properties");
- else
- {
- PatternLayoutPtr layout (new PatternLayout("%d{HH:mm:ss} %p %c{1} - %m%n"));
- ConsoleAppenderPtr appender(new ConsoleAppender(layout));
-
- BasicConfigurator::configure( appender );
- Logger::getRootLogger()->setLevel(log4cxx::Level::getInfo());
- }
-
- configured = true;
-}
-
-#endif // NDN_CXX_HAVE_LOG4CXX
diff --git a/src/util/logging.hpp b/src/util/logging.hpp
deleted file mode 100644
index 5ac0463..0000000
--- a/src/util/logging.hpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/**
- * Copyright (c) 2013-2014, Regents of the University of California.
- * All rights reserved.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- *
- * This file licensed under New BSD License. See COPYING for detailed information about
- * ndn-cxx library copyright, permissions, and redistribution restrictions.
- *
- * @author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
- * @author Zhenkai Zhu <http://irl.cs.ucla.edu/~zhenkai/>
- */
-
-#ifndef NDN_LOGGING_HPP
-#define NDN_LOGGING_HPP
-
-#include "../common.hpp"
-
-#ifdef NDN_CXX_HAVE_LOG4CXX
-
-#include <log4cxx/logger.h>
-
-#define MEMBER_LOGGER \
- static log4cxx::LoggerPtr staticModuleLogger
-
-#define INIT_MEMBER_LOGGER(className,name) \
- log4cxx::LoggerPtr className::staticModuleLogger = log4cxx::Logger::getLogger(name)
-
-#define INIT_LOGGER(name) \
- static log4cxx::LoggerPtr staticModuleLogger = log4cxx::Logger::getLogger(name)
-
-#define _LOG_DEBUG(x) \
- LOG4CXX_DEBUG(staticModuleLogger, x)
-
-#define _LOG_TRACE(x) \
- LOG4CXX_TRACE(staticModuleLogger, x)
-
-#define _LOG_FUNCTION(x) \
- LOG4CXX_TRACE(staticModuleLogger, __FUNCTION__ << "(" << x << ")")
-
-#define _LOG_FUNCTION_NOARGS \
- LOG4CXX_TRACE(staticModuleLogger, __FUNCTION__ << "()")
-
-#define _LOG_ERROR(x) \
- LOG4CXX_ERROR(staticModuleLogger, x)
-
-#define _LOG_ERROR_COND(cond,x) \
- if (cond) { _LOG_ERROR(x) }
-
-#define _LOG_DEBUG_COND(cond,x) \
- if (cond) { _LOG_DEBUG(x) }
-
-void
-INIT_LOGGERS()
-
-#else // else NDN_CXX_HAVE_LOG4CXX
-
-#define INIT_LOGGER(name) struct LOGGING_DISABLED
-#define _LOG_FUNCTION(x)
-#define _LOG_FUNCTION_NOARGS
-#define _LOG_TRACE(x)
-#define INIT_LOGGERS(x)
-#define _LOG_ERROR(x)
-#define _LOG_ERROR_COND(cond,x)
-#define _LOG_DEBUG_COND(cond,x)
-
-#define MEMBER_LOGGER
-#define INIT_MEMBER_LOGGER(className,name)
-
-#ifdef _DEBUG
-
-#include <iostream>
-
-#define _LOG_DEBUG(x) \
- { std::clog << x << std::endl; }
-
-#else
-#define _LOG_DEBUG(x)
-#endif
-
-#endif // NDN_CXX_HAVE_LOG4CXX
-
-#endif
diff --git a/wscript b/wscript
index a9d75f7..62743e0 100644
--- a/wscript
+++ b/wscript
@@ -19,8 +19,6 @@
opt.add_option('--with-tests', action='store_true', default=False, dest='with_tests',
help='''build unit tests''')
- opt.add_option('--with-log4cxx', action='store_true', default=False, dest='log4cxx',
- help='''Compile with log4cxx logging support''')
opt.add_option('--without-tools', action='store_false', default=True, dest='with_tools',
help='''Do not build tools''')
@@ -60,11 +58,6 @@
conf.check_sqlite3(mandatory=True)
conf.check_cryptopp(mandatory=True, use='PTHREAD')
- if conf.options.log4cxx:
- conf.check_cfg(package='liblog4cxx', args=['--cflags', '--libs'], uselib_store='LOG4CXX',
- mandatory=True)
- conf.define("HAVE_LOG4CXX", 1)
-
if conf.options.use_cxx11:
conf.check(msg='Checking for type std::shared_ptr',
type_name="std::shared_ptr<int>", header_name="memory",
@@ -129,7 +122,7 @@
name="ndn-cxx",
source=bld.path.ant_glob('src/**/*.cpp',
excl=['src/**/*-osx.cpp', 'src/**/*-sqlite3.cpp']),
- use='version BOOST OPENSSL LOG4CXX CRYPTOPP SQLITE3 RT PIC PTHREAD',
+ use='version BOOST OPENSSL CRYPTOPP SQLITE3 RT PIC PTHREAD',
includes=". src",
export_includes="src",
install_path='${LIBDIR}',