Index: webrtc/base/logging.h |
diff --git a/webrtc/base/logging.h b/webrtc/base/logging.h |
index 4840dfe462d9af161f6f5518781faf5996ca5d86..9347c4aaa320d11c161c7fe7d6448186f6df1a62 100644 |
--- a/webrtc/base/logging.h |
+++ b/webrtc/base/logging.h |
@@ -136,6 +136,12 @@ class LogMessage { |
LogMessage(const char* file, int line, LoggingSeverity sev, |
LogErrorContext err_ctx = ERRCTX_NONE, int err = 0, |
const char* module = NULL); |
+ |
+ LogMessage(const char* file, |
+ int line, |
+ LoggingSeverity sev, |
+ const std::string& tag); |
+ |
~LogMessage(); |
static inline bool Loggable(LoggingSeverity sev) { return (sev >= min_sev_); } |
@@ -193,7 +199,9 @@ class LogMessage { |
static void UpdateMinLogSeverity() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
// These write out the actual log messages. |
- static void OutputToDebug(const std::string& msg, LoggingSeverity severity_); |
+ static void OutputToDebug(const std::string& msg, |
+ LoggingSeverity severity, |
+ const std::string& tag); |
// The ostream that buffers the formatted message before output |
std::ostringstream print_stream_; |
@@ -201,6 +209,9 @@ class LogMessage { |
// The severity level of this message |
LoggingSeverity severity_; |
+ // The Android debug output tag. |
+ std::string android_tag_; |
+ |
// String data generated in the constructor, that should be appended to |
// the message before output. |
std::string extra_; |
@@ -341,6 +352,10 @@ inline bool LogCheckLevel(LoggingSeverity sev) { |
(errno) |
#endif // WEBRTC_WIN |
+#define LOG_TAG(sev, tag) \ |
+ LOG_SEVERITY_PRECONDITION(sev) \ |
+ rtc::LogMessage(__FILE__, __LINE__, sev, tag).stream() |
+ |
#define PLOG(sev, err) \ |
LOG_ERR_EX(sev, err) |