diff --git a/rtc_base/logging.h b/rtc_base/logging.h index 1e5f7258a3..0852c06182 100644 --- a/rtc_base/logging.h +++ b/rtc_base/logging.h @@ -464,9 +464,14 @@ class LogMessage { static void SetLogToStderr(bool log_to_stderr); // Stream: Any non-blocking stream interface. // Installs the |stream| to collect logs with severtiy |min_sev| or higher. - // |stream| must live until deinstalled by RemoveLogToStream + // |stream| must live until deinstalled by RemoveLogToStream. + // If |stream| is the first stream added to the system, we might miss some + // early concurrent log statement happening from another thread happening near + // this instant. static void AddLogToStream(LogSink* stream, LoggingSeverity min_sev); - // Removes the specified stream, without destroying it. + // Removes the specified stream, without destroying it. When the method + // has completed, it's guaranteed that |stream| will receive no more logging + // calls. static void RemoveLogToStream(LogSink* stream); // Returns the severity for the specified stream, of if none is specified, // the minimum stream severity. @@ -560,7 +565,7 @@ class LogMessage { // Holds true with high probability if |streams_| is empty, false with high // probability otherwise. Operated on with std::memory_order_relaxed because - // it's ok to loose or log some additional statements near the instant streams + // it's ok to lose or log some additional statements near the instant streams // are added/removed. static std::atomic streams_empty_;