From: g0dil Date: Fri, 12 Dec 2008 16:03:55 +0000 (+0000) Subject: Add libboost-signals library to build setup X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=8e3d9795b3dc412a9dcc3c807547c314d76c8504;p=senf.git Add libboost-signals library to build setup Utils/Logger: Enhance non-formatted time format to show seconds since first log message git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1018 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/SConstruct b/SConstruct index b992cd6..d1b492c 100644 --- a/SConstruct +++ b/SConstruct @@ -154,7 +154,7 @@ INLINE_OPTS = [ '-finline-limit=5000' ] env.Append( CPPPATH = [ '#/include' ], CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', '-Wno-long-long' ] + INLINE_OPTS, - LIBS = [ 'readline', 'rt', '$BOOSTREGEXLIB', '$BOOSTIOSTREAMSLIB' ], + LIBS = [ 'readline', 'rt', '$BOOSTREGEXLIB', '$BOOSTIOSTREAMSLIB', '$BOOSTSIGNALSLIB' ], TEST_EXTRA_LIBS = [ '$BOOSTFSLIB' ], DOXY_XREF_TYPES = [ 'bug', 'fixme', 'todo', 'idea' ], DOXY_HTML_XSL = '#/doclib/html-munge.xsl', diff --git a/Utils/Logger/IOStreamTarget.cc b/Utils/Logger/IOStreamTarget.cc index d1b30e8..286f3ba 100644 --- a/Utils/Logger/IOStreamTarget.cc +++ b/Utils/Logger/IOStreamTarget.cc @@ -43,7 +43,7 @@ prefix_ senf::log::IOStreamTarget::IOStreamTarget(std::ostream & os) : stream_ (os), tag_ (detail::getDefaultTag()), noformat_ (false), showTime_ (true), - showStream_ (false), showLevel_ (true), showArea_ (true) + showStream_ (false), showLevel_ (true), showArea_ (true), timeBase_ (-1) { std::locale const & loc (datestream_.getloc()); datestream_.imbue( std::locale( @@ -53,9 +53,10 @@ prefix_ senf::log::IOStreamTarget::IOStreamTarget(std::ostream & os) prefix_ void senf::log::IOStreamTarget::timeFormat(std::string const & format) { - if (format.empty()) + if (format.empty()) { noformat_ = true; - else { + timeBase_ = -1; + } else { noformat_ = false; std::locale const & loc (datestream_.getloc()); datestream_.imbue( std::locale( @@ -86,8 +87,14 @@ prefix_ void senf::log::IOStreamTarget::v_write(time_type timestamp, Tokenizer::iterator const i_end (tokenizer.end()); if (showTime_) { - if (noformat_) - datestream_ << std::setfill('0') << std::setw(19) << timestamp; + if (noformat_) { + if (timeBase_ == -1) timeBase_ = timestamp; + time_type delta (timestamp - timeBase_); + datestream_ << std::setfill('0') << std::setw(10) + << (delta / 1000000000ll) << '.' + << std::setfill('0') << std::setw(9) + << (delta % 1000000000ll); + } else datestream_ << senf::ClockService::abstime(timestamp); datestream_ << ' '; diff --git a/Utils/Logger/IOStreamTarget.hh b/Utils/Logger/IOStreamTarget.hh index ba4a3fd..8aa5829 100644 --- a/Utils/Logger/IOStreamTarget.hh +++ b/Utils/Logger/IOStreamTarget.hh @@ -98,6 +98,7 @@ namespace log { bool showLevel_; bool showArea_; + time_type timeBase_; }; }} diff --git a/Utils/Logger/TimeSource.cti b/Utils/Logger/TimeSource.cti index 659b65a..708de01 100644 --- a/Utils/Logger/TimeSource.cti +++ b/Utils/Logger/TimeSource.cti @@ -36,7 +36,7 @@ template prefix_ void senf::log::timeSource() { - timeSource(std::auto_ptr(new Source())); + timeSource(std::auto_ptr(new Source())); } ///////////////////////////////cti.e/////////////////////////////////////// diff --git a/debian/control b/debian/control index 92aedad..aee4b06 100644 --- a/debian/control +++ b/debian/control @@ -4,8 +4,8 @@ Maintainer: Stefan Bund Build-Depends: debhelper (>= 5), scons (>= 0.97), g++, binutils-dev, libboost-dev, libboost-test-dev, libboost-date-time-dev, libboost-regex-dev, libboost-filesystem-dev, libboost-serialization-dev, libboost-iostreams-dev, - doxygen (>= 1.5.5), libreadline-dev, dia, tidy, xsltproc, graphviz, perl-base, - linklint, netpbm + libboost-signal-dev, doxygen (>= 1.5.5), libreadline-dev, dia, tidy, xsltproc, + graphviz, perl-base, linklint, netpbm Standards-Version: 3.7.2 Section: libs @@ -36,7 +36,8 @@ Section: libdevel Architecture: all Depends: binutils-dev, libboost-dev, libboost-regex-dev, libboost-date-time-dev, libboost-thread-dev, libboost-serialization-dev, - libboost-filesystem-dev, libsenf (=${source:Version}) | libsenf-dbg (=${source:Version}) + libboost-filesystem-dev, libboost-signal-dev, + libsenf (=${source:Version}) | libsenf-dbg (=${source:Version}) Recommends: libsenf (=${source:Version}), libsenf-dbg (=${source:Version}) Suggests: libsenf-doc (=${source:Version}) Description: SENF Extensible Network Framework, header files diff --git a/senfscons/SENFSCons.py b/senfscons/SENFSCons.py index d8d287c..b1bf0c4 100644 --- a/senfscons/SENFSCons.py +++ b/senfscons/SENFSCons.py @@ -163,6 +163,7 @@ def FinalizeBoost(env): env['BOOSTREGEXLIB'] = 'boost_regex' + env['BOOST_VARIANT'] env['BOOSTFSLIB'] = 'boost_filesystem' + env['BOOST_VARIANT'] env['BOOSTIOSTREAMSLIB'] = 'boost_iostreams' + env['BOOST_VARIANT'] + env['BOOSTSIGNALSLIB'] = 'boost_signals' + env['BOOST_VARIANT'] if env['BOOST_PREFIX']: env['BOOST_LIBDIR'] = os.path.join(env['BOOST_PREFIX'], 'lib') diff --git a/senfscons/senfutil.py b/senfscons/senfutil.py index 3d2a742..af58a20 100644 --- a/senfscons/senfutil.py +++ b/senfscons/senfutil.py @@ -8,9 +8,11 @@ from SCons.Script import * # c) check for a local SENF, set options accordingly and update that SENF if needed def SetupForSENF(env): - env.Append( LIBS = [ 'senf', 'readline', 'rt', '$BOOSTREGEXLIB', '$BOOSTIOSTREAMSLIB' ], + env.Append( LIBS = [ 'senf', 'readline', 'rt', '$BOOSTREGEXLIB', + '$BOOSTIOSTREAMSLIB', '$BOOSTSIGNALSLIB' ], BOOSTREGEXLIB = 'boost_regex', BOOSTIOSTREAMSLIB = 'boost_iostreams', + BOOSTSIGNALSLIB = 'boost_signals', CXXFLAGS = [ '-Wno-long-long', '${"$CXXFLAGS_"+(final and "final" or "debug")}', '${profile and ("-g","-pg") or None}' ],