// $Id$
//
-// Copyright (C) 2007
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
+// Copyright (C) 2007
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
// Stefan Bund <g0dil@berlios.de>
//
// This program is free software; you can redistribute it and/or modify
prefix_ senf::log::Target::~Target()
{
while( ! rib_.empty()) {
- // This is terribly slow but simplifies the area cache handling and removing a target should
- // be quite seldom
+ // This is slow but simplifies the area cache handling and removing a target should be
+ // relatively seldom
RIB::reverse_iterator i (rib_.rbegin());
unroute(i->stream_, i->area_, i->level_, i->action_);
}
area->updateRoutingCache(*this, *stream, limit);
}
-prefix_ void senf::log::Target::write(boost::posix_time::ptime timestamp,
+prefix_ void senf::log::Target::write(time_type timestamp,
detail::StreamBase const & stream,
detail::AreaBase const & area, unsigned level,
std::string const & message)
AreaBase const & area, unsigned level,
std::string msg)
{
- if (fallbackRouting_)
- static_cast<Target &>(ConsoleTarget::instance()).v_write(
- (*timeSource_)(), stream.v_name(), area.v_name(), level, msg );
+ if (fallbackRouting_) {
+ if (level >= stream.defaultRuntimeLimit())
+ static_cast<Target &>(ConsoleTarget::instance()).v_write(
+ TimeSource::now(), stream.v_name(), area.v_name(), level, msg );
+ }
else
- area.write( (*timeSource_)(), stream, level, msg );
-}
-
-///////////////////////////////////////////////////////////////////////////
-// senf::log::TimeSource
-
-prefix_ senf::log::TimeSource::~TimeSource()
-{}
-
-///////////////////////////////////////////////////////////////////////////
-// senf::log::SystemTimeSource
-
-prefix_ boost::posix_time::ptime senf::log::SystemTimeSource::operator()()
- const
-{
- return boost::posix_time::microsec_clock::universal_time();
+ area.write( TimeSource::now(), stream, level, msg );
}
///////////////////////////////cc.e////////////////////////////////////////