From 5105b5ea82b1100751d8d62556a8ee56e01f2657 Mon Sep 17 00:00:00 2001 From: John Zhao Date: Wed, 16 Jan 2019 10:38:46 +0800 Subject: [PATCH] feat(miniglog): remove log_severity_global --- include/mynteye/logger.h | 1 + include/mynteye/miniglog.h | 8 ++------ src/mynteye/miniglog.cc | 2 -- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/mynteye/logger.h b/include/mynteye/logger.h index 91b83fb..823fac7 100644 --- a/include/mynteye/logger.h +++ b/include/mynteye/logger.h @@ -86,6 +86,7 @@ struct glog_init { #else #define MYNTEYE_MAX_LOG_LEVEL google::INFO +// #define MYNTEYE_MAX_LOG_LEVEL 2 #include "mynteye/miniglog.h" diff --git a/include/mynteye/miniglog.h b/include/mynteye/miniglog.h index 02d377a..83ca179 100644 --- a/include/mynteye/miniglog.h +++ b/include/mynteye/miniglog.h @@ -157,9 +157,6 @@ class MYNTEYE_API LogSink { // Global set of log sinks. The actual object is defined in logging.cc. MYNTEYE_API extern std::set log_sinks_global; -// Added by chachi - a runtime global maximum log level. Defined in logging.cc -MYNTEYE_API extern int log_severity_global; - inline void InitGoogleLogging(char */*argv*/) { // Do nothing; this is ignored. } @@ -315,9 +312,8 @@ class MYNTEYE_API LoggerVoidify { // Log only if condition is met. Otherwise evaluates to void. #define LOG_IF(severity, condition) \ - (static_cast(severity) > google::log_severity_global || !(condition)) ? \ - (void) 0 : LoggerVoidify() & \ - MessageLogger((char *)__FILE__, __LINE__, "native", severity).stream() + !(condition) ? (void) 0 : LoggerVoidify() & \ + MessageLogger((char *)__FILE__, __LINE__, "native", severity).stream() // Log only if condition is NOT met. Otherwise evaluates to void. #define LOG_IF_FALSE(severity, condition) LOG_IF(severity, !(condition)) diff --git a/src/mynteye/miniglog.cc b/src/mynteye/miniglog.cc index 0bda4be..8825038 100644 --- a/src/mynteye/miniglog.cc +++ b/src/mynteye/miniglog.cc @@ -36,6 +36,4 @@ namespace google { // that there is only one instance of this across the entire program. std::set log_sinks_global; -int log_severity_global(INFO); - } // namespace google