You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ti...@apache.org on 2015/03/27 16:24:19 UTC

[1/2] mesos git commit: Added << operator to stout::flags.

Repository: mesos
Updated Branches:
  refs/heads/master c6643f71c -> 04f8302c0


Added << operator to stout::flags.

Review: https://reviews.apache.org/r/32105


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/6a342297
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/6a342297
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/6a342297

Branch: refs/heads/master
Commit: 6a342297ab9734bafb681692666ebaa5a5265b56
Parents: c6643f7
Author: Joerg Schad <jo...@mesosphere.io>
Authored: Fri Mar 27 16:00:17 2015 +0100
Committer: Till Toenshoff <to...@me.com>
Committed: Fri Mar 27 16:00:17 2015 +0100

----------------------------------------------------------------------
 .../3rdparty/stout/include/stout/flags/flags.hpp    | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/6a342297/3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp
index aedb6ab..fb383b4 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp
@@ -15,6 +15,7 @@
 #define __STOUT_FLAGS_FLAGS_HPP__
 
 #include <map>
+#include <ostream>
 #include <string>
 #include <typeinfo> // For typeid.
 
@@ -583,6 +584,21 @@ inline std::string FlagsBase::usage() const
   return usage;
 }
 
+
+inline std::ostream& operator << (std::ostream& stream, const FlagsBase& flags)
+{
+  std::vector<std::string> _flags;
+
+  foreachvalue (const flags::Flag& flag, flags) {
+    const Option<std::string>& value = flag.stringify(flags);
+    if (value.isSome()) {
+      _flags.push_back("--" + flag.name + "=\"" + value.get() + '"');
+    }
+  }
+
+  return stream << strings::join(" ", _flags);
+}
+
 } // namespace flags {
 
 #endif // __STOUT_FLAGS_FLAGS_HPP__


[2/2] mesos git commit: Added flags to logs at master and slave startup.

Posted by ti...@apache.org.
Added flags to logs at master and slave startup.

Review: https://reviews.apache.org/r/30931


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/04f8302c
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/04f8302c
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/04f8302c

Branch: refs/heads/master
Commit: 04f8302c0cf81196e33ac538710dc5f48cd809d9
Parents: 6a34229
Author: Joerg Schad <jo...@mesosphere.io>
Authored: Fri Mar 27 16:00:59 2015 +0100
Committer: Till Toenshoff <to...@me.com>
Committed: Fri Mar 27 16:01:01 2015 +0100

----------------------------------------------------------------------
 src/master/master.cpp | 1 +
 src/slave/slave.cpp   | 1 +
 2 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/04f8302c/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index ffccc12..7b60319 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -357,6 +357,7 @@ void Master::initialize()
 {
   LOG(INFO) << "Master " << info_.id() << " (" << info_.hostname() << ")"
             << " started on " << string(self()).substr(7);
+  LOG(INFO) << "Flags at startup: " << flags;
 
   if (process::address().ip.isLoopback()) {
     LOG(WARNING) << "\n**************************************************\n"

http://git-wip-us.apache.org/repos/asf/mesos/blob/04f8302c/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 31ca724..0f70eba 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -174,6 +174,7 @@ void Slave::signaled(int signal, int uid)
 void Slave::initialize()
 {
   LOG(INFO) << "Slave started on " << string(self()).substr(6);
+  LOG(INFO) << "Flags at startup: " << flags;
 
   if (self().address.ip.isLoopback()) {
     LOG(WARNING) << "\n**************************************************\n"