mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [mesos] asekretenko commented on a change in pull request #327: Updated glog to 0.3.5 and then to 0.4.0, added microseconds to LogSink::send().
Date Thu, 04 Apr 2019 15:32:36 GMT
asekretenko commented on a change in pull request #327: Updated glog to 0.3.5 and then to 0.4.0,
added microseconds to LogSink::send().
URL: https://github.com/apache/mesos/pull/327#discussion_r272239003
 
 

 ##########
 File path: 3rdparty/glog-0.4.0.patch
 ##########
 @@ -0,0 +1,244 @@
+diff --git a/configure.ac b/configure.ac
+index 69711b7..9b77c07 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -127,27 +127,9 @@ if test x"$acx_pthread_ok" = x"yes"; then
+   AC_CHECK_LIB(pthread, pthread_self)
+ fi
+ 
+-# Check if there is google-gflags library installed.
+-SAVE_CFLAGS="$CFLAGS"
+-SAVE_LIBS="$LIBS"
+-AC_ARG_WITH(gflags, AS_HELP_STRING[--with-gflags=GFLAGS_DIR],
+-  GFLAGS_CFLAGS="-I${with_gflags}/include"
+-  GFLAGS_LIBS="-L${with_gflags}/lib -lgflags"
+-  CFLAGS="$CFLAGS $GFLAGS_CFLAGS"
+-  LIBS="$LIBS $GFLAGS_LIBS"
+-)
+-AC_CHECK_LIB(gflags, main, ac_cv_have_libgflags=1, ac_cv_have_libgflags=0)
+-if test x"$ac_cv_have_libgflags" = x"1"; then
+-  AC_DEFINE(HAVE_LIB_GFLAGS, 1, [define if you have google gflags library])
+-  if test x"$GFLAGS_LIBS" = x""; then
+-    GFLAGS_LIBS="-lgflags"
+-  fi
+-else
+-  GFLAGS_CFLAGS=
+-  GFLAGS_LIBS=
+-fi
+-CFLAGS="$SAVE_CFLAGS"
+-LIBS="$SAVE_LIBS"
++GFLAGS_CFLAGS=
++GFLAGS_LIBS=
++ac_cv_have_libgflags=0
+ 
+ # TODO(hamaji): Use official m4 macros provided by testing libraries
+ #               once the m4 macro of Google Mocking becomes ready.
+diff --git a/src/glog/stl_logging.h.in b/src/glog/stl_logging.h.in
+index 600945d..bd935d5 100644
+--- a/src/glog/stl_logging.h.in
++++ b/src/glog/stl_logging.h.in
+@@ -59,6 +59,13 @@
+ #include <utility>
+ #include <vector>
+ 
++#if defined (__GNUC__) && !defined(_LIBCPP_VERSION)
++# define GLOG_STL_LOGGING_FOR_EXT_HASH
++# define GLOG_STL_LOGGING_FOR_EXT_SLIST
++#elif defined(_LIBCPP_VERSION)
++# define GLOG_STL_LOGGING_FOR_UNORDERED
++#endif
++
+ #ifdef GLOG_STL_LOGGING_FOR_UNORDERED
+ # include <unordered_map>
+ # include <unordered_set>
+diff --git a/src/glog/logging.h.in b/src/glog/logging.h.in
+index d6cc865..e90afab 100644
+--- a/src/glog/logging.h.in
++++ b/src/glog/logging.h.in
+@@ -1422,6 +1422,16 @@ class GOOGLE_GLOG_DLL_DECL LogSink {
+   // Sink's logging logic (message_len is such as to exclude '\n' at the end).
+   // This method can't use LOG() or CHECK() as logging system mutex(s) are held
+   // during this call.
++  virtual void send(LogSeverity severity, const char* full_filename,
++                    const char* base_filename, int line,
++                    const struct ::tm* tm_time,
++                    const char* message, size_t message_len, int usec) {
++    send(severity, full_filename, base_filename, line,
++         tm_time, message, message_len);
++  }
++  // This send() signature is obsolete.
++  // New implementations should define this in terms of
++  // the above send() method.
+   virtual void send(LogSeverity severity, const char* full_filename,
+                     const char* base_filename, int line,
+                     const struct ::tm* tm_time,
+@@ -1446,7 +1456,15 @@ class GOOGLE_GLOG_DLL_DECL LogSink {
+   // Can be useful to implement send().
+   static std::string ToString(LogSeverity severity, const char* file, int line,
+                               const struct ::tm* tm_time,
+-                              const char* message, size_t message_len);
++                              const char* message, size_t message_len,
++                              int usecs);
++
++  // Obsolete
++  static std::string ToString(LogSeverity severity, const char* file, int line,
++                              const struct ::tm* tm_time,
++                              const char* message, size_t message_len) {
++    return ToString(severity, file, line, tm_time, message, message_len ,0);
++  }
+ };
+ 
+ // Add or remove a LogSink as a consumer of logging data.  Thread-safe.
+diff --git a/src/logging.cc b/src/logging.cc
+index 0b5e6ee..9f72fe5 100644
+--- a/src/logging.cc
++++ b/src/logging.cc
+@@ -351,6 +351,7 @@ struct LogMessage::LogMessageData  {
+   };
+   time_t timestamp_;            // Time of creation of LogMessage
+   struct ::tm tm_time_;         // Time of creation of LogMessage
++  int usecs_;                   // Time of creation of LogMessage - microseconds part
+   size_t num_prefix_chars_;     // # of chars of prefix in this message
+   size_t num_chars_to_log_;     // # of chars of msg to send to log
+   size_t num_chars_to_syslog_;  // # of chars of msg to send to syslog
+@@ -516,7 +517,8 @@ class LogDestination {
+                          int line,
+                          const struct ::tm* tm_time,
+                          const char* message,
+-                         size_t message_len);
++                         size_t message_len,
++                         int usecs);
 
 Review comment:
   Glog is already defining google::int32, switched to use that.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message