Added a output operator overload for Secret::Type. This patch adds an `operator<<` overload for the `Secret::Type` protobuf enum to facilitate logging.
Review: https://reviews.apache.org/r/57929/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2fc80336 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2fc80336 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2fc80336 Branch: refs/heads/master Commit: 2fc8033624b0119e4ef77fa864f7735f07b3175f Parents: 0fea4c5 Author: Greg Mann <[email protected]> Authored: Sat Mar 25 12:04:22 2017 -0700 Committer: Anand Mazumdar <[email protected]> Committed: Sat Mar 25 12:04:22 2017 -0700 ---------------------------------------------------------------------- include/mesos/type_utils.hpp | 3 +++ include/mesos/v1/mesos.hpp | 3 +++ src/common/type_utils.cpp | 6 ++++++ src/v1/mesos.cpp | 6 ++++++ 4 files changed, 18 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/2fc80336/include/mesos/type_utils.hpp ---------------------------------------------------------------------- diff --git a/include/mesos/type_utils.hpp b/include/mesos/type_utils.hpp index 19f34a7..90b0227 100644 --- a/include/mesos/type_utils.hpp +++ b/include/mesos/type_utils.hpp @@ -322,6 +322,9 @@ std::ostream& operator<<( std::ostream& operator<<(std::ostream& stream, const Image::Type& imageType); +std::ostream& operator<<(std::ostream& stream, const Secret::Type& secretType); + + std::ostream& operator<<(std::ostream& stream, const RLimitInfo& rlimitInfo); http://git-wip-us.apache.org/repos/asf/mesos/blob/2fc80336/include/mesos/v1/mesos.hpp ---------------------------------------------------------------------- diff --git a/include/mesos/v1/mesos.hpp b/include/mesos/v1/mesos.hpp index 0fecc4a..f91a574 100644 --- a/include/mesos/v1/mesos.hpp +++ b/include/mesos/v1/mesos.hpp @@ -322,6 +322,9 @@ std::ostream& operator<<( std::ostream& operator<<(std::ostream& stream, const Image::Type& imageType); +std::ostream& operator<<(std::ostream& stream, const Secret::Type& secretType); + + template <typename T> inline std::ostream& operator<<( std::ostream& stream, http://git-wip-us.apache.org/repos/asf/mesos/blob/2fc80336/src/common/type_utils.cpp ---------------------------------------------------------------------- diff --git a/src/common/type_utils.cpp b/src/common/type_utils.cpp index 3ab2dc1..9d87a6d 100644 --- a/src/common/type_utils.cpp +++ b/src/common/type_utils.cpp @@ -643,6 +643,12 @@ ostream& operator<<(ostream& stream, const Image::Type& imageType) } +ostream& operator<<(ostream& stream, const Secret::Type& secretType) +{ + return stream << Secret::Type_Name(secretType); +} + + ostream& operator<<(ostream& stream, const hashmap<string, string>& map) { return stream << stringify(map); http://git-wip-us.apache.org/repos/asf/mesos/blob/2fc80336/src/v1/mesos.cpp ---------------------------------------------------------------------- diff --git a/src/v1/mesos.cpp b/src/v1/mesos.cpp index b21e1e7..85db891 100644 --- a/src/v1/mesos.cpp +++ b/src/v1/mesos.cpp @@ -557,6 +557,12 @@ ostream& operator<<(ostream& stream, const Image::Type& imageType) } +ostream& operator<<(ostream& stream, const Secret::Type& secretType) +{ + return stream << Secret::Type_Name(secretType); +} + + ostream& operator<<(ostream& stream, const hashmap<string, string>& map) { return stream << stringify(map);
