OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 uint32 before = Time(); | 199 uint32 before = Time(); |
200 // Must lock streams_ before accessing | 200 // Must lock streams_ before accessing |
201 CritScope cs(&crit_); | 201 CritScope cs(&crit_); |
202 for (StreamList::iterator it = streams_.begin(); it != streams_.end(); ++it) { | 202 for (StreamList::iterator it = streams_.begin(); it != streams_.end(); ++it) { |
203 if (severity_ >= it->second) { | 203 if (severity_ >= it->second) { |
204 it->first->OnLogMessage(str); | 204 it->first->OnLogMessage(str); |
205 } | 205 } |
206 } | 206 } |
207 uint32 delay = TimeSince(before); | 207 uint32 delay = TimeSince(before); |
208 if (delay >= warn_slow_logs_delay_) { | 208 if (delay >= warn_slow_logs_delay_) { |
209 LogMessage slow_log_warning = | 209 rtc::LogMessage slow_log_warning(__FILE__, __LINE__, LS_WARNING); |
210 rtc::LogMessage(__FILE__, __LINE__, LS_WARNING); | |
211 // If our warning is slow, we don't want to warn about it, because | 210 // If our warning is slow, we don't want to warn about it, because |
212 // that would lead to inifinite recursion. So, give a really big | 211 // that would lead to inifinite recursion. So, give a really big |
213 // number for the delay threshold. | 212 // number for the delay threshold. |
214 slow_log_warning.warn_slow_logs_delay_ = UINT_MAX; | 213 slow_log_warning.warn_slow_logs_delay_ = UINT_MAX; |
215 slow_log_warning.stream() << "Slow log: took " << delay << "ms to write " | 214 slow_log_warning.stream() << "Slow log: took " << delay << "ms to write " |
216 << str.size() << " bytes."; | 215 << str.size() << " bytes."; |
217 } | 216 } |
218 } | 217 } |
219 | 218 |
220 uint32 LogMessage::LogStartTime() { | 219 uint32 LogMessage::LogStartTime() { |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 } | 553 } |
555 | 554 |
556 if (state) { | 555 if (state) { |
557 state->unprintable_count_[input] = consecutive_unprintable; | 556 state->unprintable_count_[input] = consecutive_unprintable; |
558 } | 557 } |
559 } | 558 } |
560 | 559 |
561 ////////////////////////////////////////////////////////////////////// | 560 ////////////////////////////////////////////////////////////////////// |
562 | 561 |
563 } // namespace rtc | 562 } // namespace rtc |
OLD | NEW |