Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: webrtc/base/logging.cc

Issue 1835053002: Change default timestamp to 64 bits in all webrtc directories. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 bool LogMessage::thread_, LogMessage::timestamp_; 118 bool LogMessage::thread_, LogMessage::timestamp_;
119 119
120 LogMessage::LogMessage(const char* file, 120 LogMessage::LogMessage(const char* file,
121 int line, 121 int line,
122 LoggingSeverity sev, 122 LoggingSeverity sev,
123 LogErrorContext err_ctx, 123 LogErrorContext err_ctx,
124 int err, 124 int err,
125 const char* module) 125 const char* module)
126 : severity_(sev), tag_(kLibjingle) { 126 : severity_(sev), tag_(kLibjingle) {
127 if (timestamp_) { 127 if (timestamp_) {
128 uint32_t time = TimeSince(LogStartTime()); 128 int64_t time = TimeSince(LogStartTime());
129 // Also ensure WallClockStartTime is initialized, so that it matches 129 // Also ensure WallClockStartTime is initialized, so that it matches
130 // LogStartTime. 130 // LogStartTime.
131 WallClockStartTime(); 131 WallClockStartTime();
132 print_stream_ << "[" << std::setfill('0') << std::setw(3) << (time / 1000) 132 print_stream_ << "[" << std::setfill('0') << std::setw(3) << (time / 1000)
133 << ":" << std::setw(3) << (time % 1000) << std::setfill(' ') 133 << ":" << std::setw(3) << (time % 1000) << std::setfill(' ')
134 << "] "; 134 << "] ";
135 } 135 }
136 136
137 if (thread_) { 137 if (thread_) {
138 PlatformThreadId id = CurrentThreadId(); 138 PlatformThreadId id = CurrentThreadId();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 } 205 }
206 206
207 CritScope cs(&g_log_crit); 207 CritScope cs(&g_log_crit);
208 for (auto& kv : streams_) { 208 for (auto& kv : streams_) {
209 if (severity_ >= kv.second) { 209 if (severity_ >= kv.second) {
210 kv.first->OnLogMessage(str); 210 kv.first->OnLogMessage(str);
211 } 211 }
212 } 212 }
213 } 213 }
214 214
215 uint32_t LogMessage::LogStartTime() { 215 int64_t LogMessage::LogStartTime() {
216 static const uint32_t g_start = Time(); 216 static const int64_t g_start = Time();
217 return g_start; 217 return g_start;
218 } 218 }
219 219
220 uint32_t LogMessage::WallClockStartTime() { 220 uint32_t LogMessage::WallClockStartTime() {
221 static const uint32_t g_start_wallclock = time(NULL); 221 static const uint32_t g_start_wallclock = time(NULL);
222 return g_start_wallclock; 222 return g_start_wallclock;
223 } 223 }
224 224
225 void LogMessage::LogThreads(bool on) { 225 void LogMessage::LogThreads(bool on) {
226 thread_ = on; 226 thread_ = on;
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 } 549 }
550 550
551 if (state) { 551 if (state) {
552 state->unprintable_count_[input] = consecutive_unprintable; 552 state->unprintable_count_[input] = consecutive_unprintable;
553 } 553 }
554 } 554 }
555 555
556 ////////////////////////////////////////////////////////////////////// 556 //////////////////////////////////////////////////////////////////////
557 557
558 } // namespace rtc 558 } // namespace rtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698