[asterisk-scf-commits] asterisk-scf/integration/logger.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Sep 27 12:01:59 CDT 2010


branch "master" has been updated
       via  46eb099971cf5755016c739c1f4cc14acde31ec9 (commit)
       via  7b942167cd2e56d502b6f3830f82d1e87cea501a (commit)
      from  83bb32fe76d77fb9fde339d8d54f6bfa6e7bdff3 (commit)

Summary of changes:
 client/src/logger.h         |   14 ++++++++++++++
 client/test/Logger-test.cpp |    9 +++++++++
 cmake                       |    2 +-
 3 files changed, 24 insertions(+), 1 deletions(-)


- Log -----------------------------------------------------------------
commit 46eb099971cf5755016c739c1f4cc14acde31ec9
Author: David M. Lee <dlee at digium.com>
Date:   Mon Sep 27 11:59:26 2010 -0500

    Had cmake submodule pointing to some private mods.

diff --git a/cmake b/cmake
index 816dd27..9615ced 160000
--- a/cmake
+++ b/cmake
@@ -1 +1 @@
-Subproject commit 816dd2725b202e71d2f284e5b9a52ab368d4210d
+Subproject commit 9615ced9f07f8c01ca1c8b3f2b29aa5d05a185da

commit 7b942167cd2e56d502b6f3830f82d1e87cea501a
Author: David M. Lee <dlee at digium.com>
Date:   Mon Sep 27 11:57:50 2010 -0500

    Added support for streaming endl and friends.

diff --git a/client/src/logger.h b/client/src/logger.h
index f790e3e..746915a 100644
--- a/client/src/logger.h
+++ b/client/src/logger.h
@@ -87,6 +87,11 @@ public:
    template<typename T>
    CondStream &operator<<(T const &val);
 
+   /**
+    * Output operator for manipulators, such as endl.
+    */
+   CondStream &operator<<(std::ostream& (*pf)(std::ostream&));
+
 private:
    /**
     * streambuffer for writing characters.
@@ -112,6 +117,15 @@ inline CondStream &CondStream::operator<<(T const &val)
    return *this;
 }
 
+inline CondStream &CondStream::operator<<(std::ostream& (*pf)(std::ostream&))
+{
+   if (enabled)
+   {
+      stream << pf;
+   }
+   return *this;
+}
+
 /**
  * The Logger for a particular source, identified by the given name.
  */
diff --git a/client/test/Logger-test.cpp b/client/test/Logger-test.cpp
index 0216dcd..f538d81 100644
--- a/client/test/Logger-test.cpp
+++ b/client/test/Logger-test.cpp
@@ -97,4 +97,13 @@ BOOST_AUTO_TEST_CASE(test_stream_lots)
    out.check();
 }
 
+BOOST_AUTO_TEST_CASE(test_endl)
+{
+   ExpectedLogOut out("src:Info:testing\n");
+   Logger uut("src", out, Info);
+
+   uut(Info) << "testing" << std::endl;
+   out.check();
+}
+
 BOOST_AUTO_TEST_SUITE_END()

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/logger.git



More information about the asterisk-scf-commits mailing list