Add a logging_no_op.cc when enable_tracing==0.
This should hopefully fix static initializer warnings when rolling webrtc
in Chromium.
TEST=logging_unittest succeeds with enable_tracing==1 and fails appropriately with enable_tracing==0.
Review URL: https://webrtc-codereview.appspot.com/939026
git-svn-id: http://webrtc.googlecode.com/svn/trunk@3159 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/system_wrappers/interface/logging.h b/webrtc/system_wrappers/interface/logging.h
index c265245..1085fef 100644
--- a/webrtc/system_wrappers/interface/logging.h
+++ b/webrtc/system_wrappers/interface/logging.h
@@ -79,9 +79,6 @@
std::ostream& stream() { return print_stream_; }
private:
- // These assist in formatting some parts of the debug output.
- static const char* DescribeFile(const char* file);
-
// The ostream that buffers the formatted message before output
std::ostringstream print_stream_;
@@ -90,22 +87,11 @@
};
//////////////////////////////////////////////////////////////////////
-// Macros which automatically disable logging when LOGGING == 0
+// Macros which automatically disable logging when WEBRTC_LOGGING == 0
//////////////////////////////////////////////////////////////////////
-// If LOGGING is not explicitly defined, default to enabled in debug mode
-// TODO(andrew): We explictly enable here; handle in gyp instead.
-#define LOGGING 1
-#if !defined(LOGGING)
-#if defined(_DEBUG) && !defined(NDEBUG)
-#define LOGGING 1
-#else
-#define LOGGING 0
-#endif
-#endif // !defined(LOGGING)
-
#ifndef LOG
-#if LOGGING
+#if defined(WEBRTC_LOGGING)
// The following non-obvious technique for implementation of a
// conditional log stream was stolen from google3/base/logging.h.
@@ -137,7 +123,7 @@
#define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": "
#endif
-#else // !LOGGING
+#else // !defined(WEBRTC_LOGGING)
// Hopefully, the compiler will optimize away some of this code.
// Note: syntax of "1 ? (void)0 : LogMessage" was causing errors in g++,
@@ -148,7 +134,7 @@
while (false) webrtc::LogMessage(NULL, 0, sev).stream()
#define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": "
-#endif // !LOGGING
+#endif // !defined(WEBRTC_LOGGING)
#define LOG_API0() LOG_F(LS_VERBOSE)
#define LOG_API1(v1) LOG_API0() << #v1 << "=" << v1