You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ar...@apache.org on 2018/05/28 13:25:57 UTC

mesos git commit: Modified launch.cpp to writes its logs into cerr.

Repository: mesos
Updated Branches:
  refs/heads/master 285d82080 -> a83a25203


Modified launch.cpp to writes its logs into cerr.

`containerizer/mesos/launch.cpp` wrote some of its output into
`cout` and some into `cerr` without a clear distinction as to
why it was done in some cases.

Moreover, it is standard for logging utilities to write their
output into cerr, and finally in Mesos clog should probably
kept clean for the task output in cases there consumers of the
task which process the cout of it.

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


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

Branch: refs/heads/master
Commit: a83a25203cb533341dc17120526258afad6c8c85
Parents: 285d820
Author: Alexander Rojas <al...@mesosphere.io>
Authored: Mon May 28 12:30:58 2018 +0200
Committer: Alexander Rojas <al...@mesosphere.io>
Committed: Mon May 28 14:19:53 2018 +0200

----------------------------------------------------------------------
 src/slave/containerizer/mesos/launch.cpp | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a83a2520/src/slave/containerizer/mesos/launch.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/launch.cpp b/src/slave/containerizer/mesos/launch.cpp
index 70b7805..cec6558 100644
--- a/src/slave/containerizer/mesos/launch.cpp
+++ b/src/slave/containerizer/mesos/launch.cpp
@@ -73,7 +73,6 @@
 #include "slave/containerizer/mesos/paths.hpp"
 
 using std::cerr;
-using std::cout;
 using std::endl;
 using std::set;
 using std::string;
@@ -301,7 +300,7 @@ static Try<Nothing> prepareMounts(const ContainerLaunchInfo& launchInfo)
       return Error("Failed to mark '/' as rslave: " + mnt.error());
     }
 
-    cout << "Marked '/' as rslave" << endl;
+    cerr << "Marked '/' as rslave" << endl;
   } else {
     hashset<string> sharedMountTargets;
     foreach (const ContainerMountInfo& mount, launchInfo.mounts()) {
@@ -435,7 +434,7 @@ static Try<Nothing> prepareMounts(const ContainerLaunchInfo& launchInfo)
           "': " + mnt.error());
     }
 
-    cout << "Prepared mount '" << JSON::protobuf(mount) << "'" << endl;
+    cerr << "Prepared mount '" << JSON::protobuf(mount) << "'" << endl;
   }
 #endif // __linux__
 
@@ -706,7 +705,7 @@ int MesosContainerizerLaunch::execute()
   // processing the container mounts so that container mounts can be made on
   // top of the rootfs template.
   if (launchInfo.has_rootfs()) {
-    cout << "Preparing rootfs at " << launchInfo.rootfs() << endl;
+    cerr << "Preparing rootfs at " << launchInfo.rootfs() << endl;
 
     Try<Nothing> prepare = prepareChroot(launchInfo.rootfs());
 
@@ -730,7 +729,7 @@ int MesosContainerizerLaunch::execute()
       exitWithStatus(EXIT_FAILURE);
     }
 
-    cout << "Executing pre-exec command '"
+    cerr << "Executing pre-exec command '"
          << JSON::protobuf(command) << "'" << endl;
 
     Option<int> status;
@@ -866,7 +865,7 @@ int MesosContainerizerLaunch::execute()
 
   // Change root to a new root, if provided.
   if (launchInfo.has_rootfs()) {
-    cout << "Changing root to " << launchInfo.rootfs() << endl;
+    cerr << "Changing root to " << launchInfo.rootfs() << endl;
 
     Try<Nothing> enter = enterChroot(launchInfo.rootfs());
 
@@ -1054,7 +1053,7 @@ int MesosContainerizerLaunch::execute()
       // TODO(tillt): Once we have a solution for MESOS-7292, allow
       // logging of values.
       if (environment.contains(name) && environment[name] != value) {
-        cout << "Overwriting environment variable '" << name << "'" << endl;
+        cerr << "Overwriting environment variable '" << name << "'" << endl;
       }
 
       environment[name] = value;