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

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: Add TODO for timestamp. Created 4 years, 7 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
« no previous file with comments | « webrtc/base/logging.h ('k') | webrtc/base/logging_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 bool LogMessage::thread_, LogMessage::timestamp_; 117 bool LogMessage::thread_, LogMessage::timestamp_;
118 118
119 LogMessage::LogMessage(const char* file, 119 LogMessage::LogMessage(const char* file,
120 int line, 120 int line,
121 LoggingSeverity sev, 121 LoggingSeverity sev,
122 LogErrorContext err_ctx, 122 LogErrorContext err_ctx,
123 int err, 123 int err,
124 const char* module) 124 const char* module)
125 : severity_(sev), tag_(kLibjingle) { 125 : severity_(sev), tag_(kLibjingle) {
126 if (timestamp_) { 126 if (timestamp_) {
127 uint32_t time = TimeSince(LogStartTime()); 127 int64_t time = TimeSince(LogStartTime());
128 // Also ensure WallClockStartTime is initialized, so that it matches 128 // Also ensure WallClockStartTime is initialized, so that it matches
129 // LogStartTime. 129 // LogStartTime.
130 WallClockStartTime(); 130 WallClockStartTime();
131 print_stream_ << "[" << std::setfill('0') << std::setw(3) << (time / 1000) 131 print_stream_ << "[" << std::setfill('0') << std::setw(3) << (time / 1000)
132 << ":" << std::setw(3) << (time % 1000) << std::setfill(' ') 132 << ":" << std::setw(3) << (time % 1000) << std::setfill(' ')
133 << "] "; 133 << "] ";
134 } 134 }
135 135
136 if (thread_) { 136 if (thread_) {
137 PlatformThreadId id = CurrentThreadId(); 137 PlatformThreadId id = CurrentThreadId();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 } 202 }
203 203
204 CritScope cs(&g_log_crit); 204 CritScope cs(&g_log_crit);
205 for (auto& kv : streams_) { 205 for (auto& kv : streams_) {
206 if (severity_ >= kv.second) { 206 if (severity_ >= kv.second) {
207 kv.first->OnLogMessage(str); 207 kv.first->OnLogMessage(str);
208 } 208 }
209 } 209 }
210 } 210 }
211 211
212 uint32_t LogMessage::LogStartTime() { 212 int64_t LogMessage::LogStartTime() {
213 static const uint32_t g_start = Time(); 213 static const int64_t g_start = TimeMillis();
214 return g_start; 214 return g_start;
215 } 215 }
216 216
217 uint32_t LogMessage::WallClockStartTime() { 217 uint32_t LogMessage::WallClockStartTime() {
218 static const uint32_t g_start_wallclock = time(NULL); 218 static const uint32_t g_start_wallclock = time(NULL);
219 return g_start_wallclock; 219 return g_start_wallclock;
220 } 220 }
221 221
222 void LogMessage::LogThreads(bool on) { 222 void LogMessage::LogThreads(bool on) {
223 thread_ = on; 223 thread_ = on;
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 } 546 }
547 547
548 if (state) { 548 if (state) {
549 state->unprintable_count_[input] = consecutive_unprintable; 549 state->unprintable_count_[input] = consecutive_unprintable;
550 } 550 }
551 } 551 }
552 552
553 ////////////////////////////////////////////////////////////////////// 553 //////////////////////////////////////////////////////////////////////
554 554
555 } // namespace rtc 555 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/logging.h ('k') | webrtc/base/logging_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698