IBR-DTNSuite
0.8
|
#include <ibrcommon/thread/Queue.h>
#include <ibrcommon/thread/Thread.h>
#include <ibrcommon/data/File.h>
#include <fstream>
#include <sys/time.h>
#include <iostream>
#include <sstream>
#include <list>
Go to the source code of this file.
Classes | |
class | ibrcommon::Logger |
class | ibrcommon::Logger::LoggerOutput |
class | ibrcommon::Logger::LogWriter |
Namespaces | |
namespace | ibrcommon |
Defines | |
#define | IBRCOMMON_LOGGER_LEVEL ibrcommon::Logger::getVerbosity() |
#define | IBRCOMMON_LOGGER(level) |
#define | IBRCOMMON_LOGGER_DEBUG(verbosity) |
#define | IBRCOMMON_LOGGER_ENDL |
#define | IBRCOMMON_LOGGER_ex(level) IBRCOMMON_LOGGER(level) << __PRETTY_FUNCTION__ << ": " |
#define | IBRCOMMON_LOGGER_DEBUG_ex(verbosity) IBRCOMMON_LOGGER_DEBUG(verbosity) << __FILE__ << ":" << __LINE__ << " in " << __PRETTY_FUNCTION__ << ": " |
This file provides common logging facilities. For easy usage it provides some defines and is usable like a standard output stream. It is fully configurable, can log to all standard output streams and to the system syslog.
Provided tags: emergency, alert, critical, error, warning, notice, info
Example log message with info tag:
IBRCOMMON_LOGGER(info) << "Some output..." << IBRCOMMON_ENDL;
Example debug with verbose level 42:
IBRCOMMON_LOGGER_DEBUG(42) << "some debugging output" << IBRCOMMON_ENDL;
To check the current verbose level in the code use the IBRCOMMON_LOGGER_LEVEL define like this:
if (IBRCOMMON_LOGGER_LEVEL > 42) { do something... }
Definition in file Logger.h.
#define IBRCOMMON_LOGGER | ( | level | ) |
{ \ ibrcommon::Logger log = ibrcommon::Logger::level(); \ log
Definition at line 66 of file Logger.h.
Referenced by __daemon_run(), ibrcommon::TLSStream::activate(), dtn::daemon::StandByManager::adopt(), ibrcommon::AES128Stream::AES128Stream(), dtn::net::IPNDAgent::bind(), dtn::daemon::CapsuleWorker::callbackBundleReceived(), dtn::daemon::DTNTPWorker::callbackBundleReceived(), dtn::daemon::DevNull::callbackBundleReceived(), dtn::storage::SQLiteDatabase::close(), dtn::routing::BaseRouter::componentDown(), dtn::core::FragmentManager::componentRun(), dtn::net::FileConvergenceLayer::componentRun(), dtn::net::UDPConvergenceLayer::componentRun(), dtn::net::DatagramConvergenceLayer::componentRun(), dtn::dht::DHTNameService::componentRun(), dtn::net::IPNDAgent::componentUp(), dtn::daemon::StatisticLogger::componentUp(), dtn::net::UDPConvergenceLayer::componentUp(), dtn::dht::DHTNameService::componentUp(), dtn::routing::BaseRouter::componentUp(), dtn::storage::SQLiteConfigure::configure(), dtn::net::TCPConnection::connect(), dtn::api::Client::connect(), dtn::net::DatagramConvergenceLayer::connectionDown(), ibrcommon::BLOB::copy(), dtn::storage::SQLiteDatabase::count(), createBundleStorage(), createConvergenceLayers(), dtn::security::PayloadConfidentialBlock::decrypt(), dtn::security::PayloadConfidentialBlock::decryptPayload(), dtn_dht_handle_lookup_result(), dtn::routing::EpidemicRoutingExtension::EpidemicRoutingExtension(), dtn::net::TCPConnection::eventBundleForwarded(), dtn::net::TCPConnection::eventBundleRefused(), dtn::net::TCPConnection::eventConnectionUp(), dtn::storage::SimpleBundleStorage::eventDataStorageRemoveFailed(), dtn::storage::SimpleBundleStorage::eventDataStorageStoreFailed(), ibrcommon::vsocket::eventNotify(), dtn::routing::FloodRoutingExtension::FloodRoutingExtension(), dtn::storage::MemoryBundleStorage::get(), dtn::security::SecurityKeyManager::get(), dtn::storage::SimpleBundleStorage::get(), dtn::storage::SQLiteBundleStorage::get(), dtn::storage::SQLiteDatabase::get(), ibrcommon::TLSStream::init(), dtn::security::SecurityKeyManager::initialize(), dtn::core::AbstractWorker::initialize(), dtn::net::TCPConnection::initialize(), dtn::security::SecurityCertificateManager::initialize(), initialize_blobs(), ibrcommon::iostreamBIO::iostreamBIO(), dtn::net::IPNDAgent::IPNDAgent(), dtn::storage::SimpleBundleStorage::iterateDataStorage(), ibrcommon::JoinableThread::join(), dtn::daemon::Configuration::load(), dtn::daemon::Configuration::Security::load(), dtn::routing::NeighborRoutingExtension::notify(), dtn::storage::SQLiteDatabase::open(), ibrcommon::RSASHA256Stream::overflow(), dtn::core::BundleCore::processBlocks(), dtn::routing::NodeHandshakeExtension::processHandshake(), dtn::routing::ProphetRoutingExtension::processHandshake(), dtn::api::ApiServer::processIncomingBundle(), dtn::routing::ProphetRoutingExtension::ProphetRoutingExtension(), ibrcommon::lowpanstream::queue(), dtn::core::EventDebugger::raiseEvent(), dtn::daemon::DTNTPWorker::raiseEvent(), dtn::routing::BaseRouter::raiseEvent(), ibrcommon::RSASHA256Stream::reset(), ibrcommon::RSASHA256Stream::RSASHA256Stream(), dtn::api::BinaryStreamClient::run(), ibrcommon::NetLink3Manager::run(), ibrcommon::NetLinkManager::run(), dtn::net::TCPConnection::run(), dtn::net::LOWPANDatagramService::send(), dtn::net::LOWPANConvergenceLayer::send_cb(), dtn::net::LOWPANConvergenceLayer::sendAnnoucement(), setGlobalVars(), dtn::utils::Clock::setOffset(), dtn::utils::Clock::settimeofday(), sighandler(), dtn::storage::SimpleBundleStorage::SimpleBundleStorage(), dtn::daemon::IndependentComponent::startup(), dtn::daemon::StatisticLogger::StatisticLogger(), dtn::storage::SQLiteDatabase::store(), switchUser(), ibrcommon::tcpstream::tcpstream(), dtn::storage::SQLiteDatabase::update(), dtn::core::BundleCore::validate(), dtn::security::SecurityCertificateManager::validateSubject(), and ibrcommon::vsocket::vsocket().
#define IBRCOMMON_LOGGER_DEBUG | ( | verbosity | ) |
if (ibrcommon::Logger::getVerbosity() >= verbosity) \ { \ ibrcommon::Logger log = ibrcommon::Logger::debug(verbosity); \ log
Definition at line 71 of file Logger.h.
Referenced by __daemon_run(), dtn::net::DatagramConnection::ack(), dtn::routing::NeighborDatabase::NeighborEntry::acquireTransfer(), dtn::net::ConnectionManager::addConnection(), dtn::security::SecurityManager::auth(), ibrcommon::NetLink3Manager::callback(), dtn::daemon::EchoWorker::callbackBundleReceived(), dtn::daemon::Debugger::callbackBundleReceived(), ibrcommon::TLSStream::close(), dtn::routing::SummaryVector::commit(), dtn::dht::DHTNameService::componentDown(), dtn::core::FragmentManager::componentRun(), dtn::net::LOWPANConvergenceLayer::componentRun(), dtn::api::ApiServer::componentRun(), dtn::net::HTTPConvergenceLayer::componentRun(), dtn::net::DatagramConvergenceLayer::componentRun(), dtn::dht::DHTNameService::componentRun(), dtn::net::LOWPANConvergenceLayer::componentUp(), dtn::net::DatagramConvergenceLayer::componentUp(), dtn::dht::DHTNameService::componentUp(), dtn::net::TCPConnection::connect(), dtn::api::ApiServer::connectionDown(), dtn::net::DatagramConvergenceLayer::connectionDown(), dtn::api::ApiServer::connectionUp(), dtn::net::DatagramConvergenceLayer::connectionUp(), dtn::security::SecurityManager::decrypt(), dtn::routing::ProphetRoutingExtension::DeliveryPredictabilityMap::deserialize(), dtn::net::ConnectionManager::discovered(), dtn::daemon::DTNTPWorker::DTNTPWorker(), dtn::security::SecurityManager::encrypt(), dtn::api::BinaryStreamClient::eventConnectionDown(), dtn::net::TCPConnection::eventConnectionDown(), dtn::api::Client::eventConnectionDown(), dtn::api::BinaryStreamClient::eventConnectionUp(), ibrcommon::vsocket::eventNotify(), ibrcommon::Thread::exec_thread(), dtn::routing::NeighborDatabase::NeighborEntry::expire(), dtn::security::SecurityManager::fastverify(), dtn::api::OrderedStreamHandler::finally(), dtn::api::ExtendedApiHandler::finally(), dtn::api::BinaryStreamClient::finally(), dtn::net::DatagramConnection::finally(), dtn::api::ClientHandler::finally(), dtn::net::TCPConnection::finally(), dtn::api::ApiServer::freeRegistration(), dtn::api::OrderedStreamHandler::get(), dtn::storage::SQLiteBundleStorage::get(), dtn::storage::SQLiteDatabase::get(), dtn::security::SecurityBlock::isSecurityDestination(), dtn::security::SecurityBlock::isSecuritySource(), ibrcommon::MulticastSocket::joinGroup(), ibrcommon::NetLink3ManagerEvent::NetLink3ManagerEvent(), ibrcommon::NetLinkManagerEvent::NetLinkManagerEvent(), dtn::net::operator<<(), dtn::api::PlainDeserializer::operator>>(), dtn::data::DefaultDeserializer::operator>>(), dtn::net::operator>>(), ibrcommon::lowpanstream::overflow(), ibrcommon::tcpstream::overflow(), ibrcommon::TLSStream::overflow(), dtn::security::SecurityManager::prefetchKey(), dtn::api::OrderedStreamHandler::put(), dtn::net::LOWPANConnectionSender::queue(), ibrcommon::lowpanstream::queue(), dtn::net::LOWPANConvergenceLayer::queue(), dtn::net::UDPConvergenceLayer::queue(), dtn::net::DatagramConnection::queue(), dtn::net::ConnectionManager::queue(), dtn::net::DatagramConvergenceLayer::queue(), dtn::net::TCPConvergenceLayer::queue(), dtn::core::EventDebugger::raiseEvent(), dtn::daemon::DTNTPWorker::raiseEvent(), dtn::net::ConnectionManager::raiseEvent(), dtn::core::BundleCore::raiseEvent(), dtn::net::DiscoveryAgent::received(), dtn::net::LOWPANDatagramService::recvfrom(), dtn::net::UDPDatagramService::recvfrom(), dtn::routing::NeighborDatabase::NeighborEntry::releaseTransfer(), dtn::storage::SQLiteDatabase::remove(), dtn::net::ConnectionManager::removeConnection(), dtn::net::LOWPANConnectionSender::run(), dtn::routing::NeighborRoutingExtension::run(), dtn::api::ExtendedApiHandler::run(), dtn::routing::FloodRoutingExtension::run(), dtn::routing::StaticRoutingExtension::run(), dtn::api::BinaryStreamClient::run(), dtn::routing::EpidemicRoutingExtension::run(), dtn::net::DatagramConnection::run(), dtn::net::LOWPANConnection::run(), ibrcommon::NetLinkManager::run(), dtn::net::DownloadThread::run(), dtn::net::TCPConnection::run(), ibrcommon::tcpstream::select(), ibrcommon::vsocket::select(), ibrcommon::udpsocket::send(), dtn::net::UDPDatagramService::send(), dtn::net::LOWPANConvergenceLayer::sendAnnoucement(), ibrcommon::vsocket::sendto(), dtn::routing::ProphetRoutingExtension::DeliveryPredictabilityMap::serialize(), dtn::core::FragmentManager::setOffset(), dtn::net::DatagramConnection::shutdown(), dtn::net::TCPConnection::shutdown(), dtn::security::SecurityManager::sign(), dtn::storage::sql_tracer(), dtn::storage::MemoryBundleStorage::store(), dtn::storage::SQLiteBundleStorage::store(), ibrcommon::lowpanstream::sync(), dtn::net::DiscoveryAgent::timeout(), dtn::api::ApiServer::timeout(), ibrcommon::Base64Reader::underflow(), dtn::api::BundleStreamBuf::underflow(), ibrcommon::lowpanstream::underflow(), ibrcommon::tcpstream::underflow(), ibrcommon::TLSStream::underflow(), dtn::api::Registration::underflow(), dtn::security::BundleAuthenticationBlock::verify(), dtn::security::SecurityManager::verifyBAB(), dtn::security::SecurityManager::verifyPIB(), dtn::net::FileMonitor::watch(), and dtn::api::Client::~Client().
#define IBRCOMMON_LOGGER_DEBUG_ex | ( | verbosity | ) | IBRCOMMON_LOGGER_DEBUG(verbosity) << __FILE__ << ":" << __LINE__ << " in " << __PRETTY_FUNCTION__ << ": " |
Definition at line 85 of file Logger.h.
Referenced by dtn::security::MutualSerializer::getLength().
#define IBRCOMMON_LOGGER_ENDL |
std::flush; \ log.print(); \ }
Definition at line 77 of file Logger.h.
Referenced by __daemon_run(), dtn::net::DatagramConnection::ack(), dtn::routing::NeighborDatabase::NeighborEntry::acquireTransfer(), ibrcommon::TLSStream::activate(), dtn::net::ConnectionManager::addConnection(), dtn::security::SecurityBlock::addKey(), dtn::daemon::StandByManager::adopt(), ibrcommon::AES128Stream::AES128Stream(), dtn::security::SecurityManager::auth(), dtn::net::IPNDAgent::bind(), ibrcommon::NetLink3Manager::callback(), dtn::daemon::EchoWorker::callbackBundleReceived(), dtn::daemon::CapsuleWorker::callbackBundleReceived(), dtn::daemon::DTNTPWorker::callbackBundleReceived(), dtn::daemon::DevNull::callbackBundleReceived(), dtn::daemon::Debugger::callbackBundleReceived(), ibrcommon::TLSStream::close(), dtn::storage::SQLiteDatabase::close(), dtn::routing::SummaryVector::commit(), dtn::dht::DHTNameService::componentDown(), dtn::routing::BaseRouter::componentDown(), dtn::core::FragmentManager::componentRun(), dtn::net::FileConvergenceLayer::componentRun(), dtn::net::UDPConvergenceLayer::componentRun(), dtn::net::LOWPANConvergenceLayer::componentRun(), dtn::api::ApiServer::componentRun(), dtn::net::HTTPConvergenceLayer::componentRun(), dtn::net::DatagramConvergenceLayer::componentRun(), dtn::dht::DHTNameService::componentRun(), dtn::net::IPNDAgent::componentUp(), dtn::daemon::StatisticLogger::componentUp(), dtn::net::UDPConvergenceLayer::componentUp(), dtn::net::LOWPANConvergenceLayer::componentUp(), dtn::net::DatagramConvergenceLayer::componentUp(), dtn::dht::DHTNameService::componentUp(), dtn::routing::BaseRouter::componentUp(), dtn::storage::SQLiteConfigure::configure(), dtn::net::TCPConnection::connect(), dtn::api::Client::connect(), dtn::api::ApiServer::connectionDown(), dtn::net::DatagramConvergenceLayer::connectionDown(), dtn::api::ApiServer::connectionUp(), dtn::net::DatagramConvergenceLayer::connectionUp(), ibrcommon::BLOB::copy(), dtn::storage::SQLiteDatabase::count(), createBundleStorage(), createConvergenceLayers(), dtn::security::SecurityBlock::createSaltAndKey(), dtn::security::ExtensionSecurityBlock::decrypt(), dtn::security::PayloadConfidentialBlock::decrypt(), dtn::security::SecurityManager::decrypt(), dtn::security::PayloadConfidentialBlock::decryptPayload(), dtn::routing::ProphetRoutingExtension::DeliveryPredictabilityMap::deserialize(), dtn::net::ConnectionManager::discovered(), dtn_dht_handle_lookup_result(), dtn::daemon::DTNTPWorker::DTNTPWorker(), dtn::security::SecurityManager::encrypt(), dtn::routing::EpidemicRoutingExtension::EpidemicRoutingExtension(), dtn::net::TCPConnection::eventBundleForwarded(), dtn::net::TCPConnection::eventBundleRefused(), dtn::api::BinaryStreamClient::eventConnectionDown(), dtn::net::TCPConnection::eventConnectionDown(), dtn::api::Client::eventConnectionDown(), dtn::api::BinaryStreamClient::eventConnectionUp(), dtn::net::TCPConnection::eventConnectionUp(), dtn::storage::SimpleBundleStorage::eventDataStorageRemoveFailed(), dtn::storage::SimpleBundleStorage::eventDataStorageStoreFailed(), ibrcommon::vsocket::eventNotify(), ibrcommon::Thread::exec_thread(), dtn::routing::NeighborDatabase::NeighborEntry::expire(), dtn::security::SecurityManager::fastverify(), dtn::api::OrderedStreamHandler::finally(), dtn::api::ExtendedApiHandler::finally(), dtn::api::BinaryStreamClient::finally(), dtn::net::DatagramConnection::finally(), dtn::api::ClientHandler::finally(), dtn::net::TCPConnection::finally(), dtn::routing::FloodRoutingExtension::FloodRoutingExtension(), dtn::api::ApiServer::freeRegistration(), dtn::api::OrderedStreamHandler::get(), dtn::storage::MemoryBundleStorage::get(), dtn::security::SecurityKeyManager::get(), dtn::storage::SimpleBundleStorage::get(), dtn::storage::SQLiteBundleStorage::get(), dtn::storage::SQLiteDatabase::get(), dtn::security::SecurityBlock::getKey(), dtn::security::MutualSerializer::getLength(), ibrcommon::TLSStream::init(), dtn::security::SecurityKeyManager::initialize(), dtn::core::AbstractWorker::initialize(), dtn::net::TCPConnection::initialize(), dtn::security::SecurityCertificateManager::initialize(), initialize_blobs(), ibrcommon::iostreamBIO::iostreamBIO(), dtn::net::IPNDAgent::IPNDAgent(), dtn::security::SecurityBlock::isSecurityDestination(), dtn::security::SecurityBlock::isSecuritySource(), dtn::storage::SimpleBundleStorage::iterateDataStorage(), ibrcommon::JoinableThread::join(), ibrcommon::MulticastSocket::joinGroup(), dtn::daemon::Configuration::load(), dtn::daemon::Configuration::Security::load(), ibrcommon::NetLink3ManagerEvent::NetLink3ManagerEvent(), ibrcommon::NetLinkManagerEvent::NetLinkManagerEvent(), dtn::routing::NeighborRoutingExtension::notify(), dtn::storage::SQLiteDatabase::open(), dtn::net::operator<<(), dtn::api::PlainDeserializer::operator>>(), dtn::data::DefaultDeserializer::operator>>(), dtn::net::operator>>(), ibrcommon::lowpanstream::overflow(), ibrcommon::tcpstream::overflow(), ibrcommon::RSASHA256Stream::overflow(), ibrcommon::TLSStream::overflow(), dtn::security::SecurityManager::prefetchKey(), dtn::core::BundleCore::processBlocks(), dtn::routing::NodeHandshakeExtension::processHandshake(), dtn::routing::ProphetRoutingExtension::processHandshake(), dtn::api::ApiServer::processIncomingBundle(), dtn::routing::ProphetRoutingExtension::ProphetRoutingExtension(), dtn::api::OrderedStreamHandler::put(), dtn::net::LOWPANConnectionSender::queue(), ibrcommon::lowpanstream::queue(), dtn::net::LOWPANConvergenceLayer::queue(), dtn::net::UDPConvergenceLayer::queue(), dtn::net::DatagramConnection::queue(), dtn::net::ConnectionManager::queue(), dtn::net::DatagramConvergenceLayer::queue(), dtn::net::TCPConvergenceLayer::queue(), dtn::core::EventDebugger::raiseEvent(), dtn::daemon::DTNTPWorker::raiseEvent(), dtn::net::ConnectionManager::raiseEvent(), dtn::core::BundleCore::raiseEvent(), dtn::routing::BaseRouter::raiseEvent(), dtn::net::DiscoveryAgent::received(), dtn::net::LOWPANDatagramService::recvfrom(), dtn::net::UDPDatagramService::recvfrom(), dtn::routing::NeighborDatabase::NeighborEntry::releaseTransfer(), dtn::storage::SQLiteDatabase::remove(), dtn::net::ConnectionManager::removeConnection(), ibrcommon::RSASHA256Stream::reset(), ibrcommon::RSASHA256Stream::RSASHA256Stream(), dtn::net::LOWPANConnectionSender::run(), dtn::routing::NeighborRoutingExtension::run(), dtn::api::ExtendedApiHandler::run(), dtn::routing::FloodRoutingExtension::run(), dtn::api::BinaryStreamClient::run(), dtn::routing::StaticRoutingExtension::run(), dtn::routing::EpidemicRoutingExtension::run(), dtn::net::DatagramConnection::run(), dtn::net::LOWPANConnection::run(), ibrcommon::NetLink3Manager::run(), ibrcommon::NetLinkManager::run(), dtn::net::DownloadThread::run(), dtn::net::TCPConnection::run(), ibrcommon::tcpstream::select(), ibrcommon::vsocket::select(), ibrcommon::udpsocket::send(), dtn::net::LOWPANDatagramService::send(), dtn::net::UDPDatagramService::send(), dtn::net::LOWPANConvergenceLayer::send_cb(), dtn::net::LOWPANConvergenceLayer::sendAnnoucement(), ibrcommon::vsocket::sendto(), dtn::routing::ProphetRoutingExtension::DeliveryPredictabilityMap::serialize(), setGlobalVars(), dtn::core::FragmentManager::setOffset(), dtn::utils::Clock::setOffset(), dtn::utils::Clock::settimeofday(), dtn::net::DatagramConnection::shutdown(), dtn::net::TCPConnection::shutdown(), sighandler(), dtn::security::SecurityManager::sign(), dtn::storage::SimpleBundleStorage::SimpleBundleStorage(), dtn::storage::sql_tracer(), dtn::daemon::IndependentComponent::startup(), dtn::daemon::StatisticLogger::StatisticLogger(), dtn::storage::MemoryBundleStorage::store(), dtn::storage::SQLiteBundleStorage::store(), dtn::storage::SQLiteDatabase::store(), switchUser(), ibrcommon::lowpanstream::sync(), ibrcommon::tcpstream::tcpstream(), dtn::net::DiscoveryAgent::timeout(), dtn::api::ApiServer::timeout(), ibrcommon::Base64Reader::underflow(), dtn::api::BundleStreamBuf::underflow(), ibrcommon::lowpanstream::underflow(), ibrcommon::tcpstream::underflow(), ibrcommon::TLSStream::underflow(), dtn::api::Registration::underflow(), dtn::storage::SQLiteDatabase::update(), dtn::core::BundleCore::validate(), dtn::security::SecurityCertificateManager::validateSubject(), dtn::security::BundleAuthenticationBlock::verify(), dtn::security::SecurityManager::verifyBAB(), dtn::security::SecurityManager::verifyPIB(), ibrcommon::vsocket::vsocket(), dtn::net::FileMonitor::watch(), and dtn::api::Client::~Client().
#define IBRCOMMON_LOGGER_ex | ( | level | ) | IBRCOMMON_LOGGER(level) << __PRETTY_FUNCTION__ << ": " |
Definition at line 82 of file Logger.h.
Referenced by dtn::security::SecurityBlock::addKey(), dtn::security::SecurityBlock::createSaltAndKey(), dtn::security::ExtensionSecurityBlock::decrypt(), and dtn::security::SecurityBlock::getKey().
Definition at line 63 of file Logger.h.
Referenced by dtn::storage::SQLiteDatabase::open(), and dtn::net::ConnectionManager::queue().