OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 file_count_text_(0), | 69 file_count_text_(0), |
70 trace_file_(FileWrapper::Create()) { | 70 trace_file_(FileWrapper::Create()) { |
71 } | 71 } |
72 | 72 |
73 TraceImpl::~TraceImpl() { | 73 TraceImpl::~TraceImpl() { |
74 trace_file_->Flush(); | 74 trace_file_->Flush(); |
75 trace_file_->CloseFile(); | 75 trace_file_->CloseFile(); |
76 } | 76 } |
77 | 77 |
78 int32_t TraceImpl::AddThreadId(char* trace_message) const { | 78 int32_t TraceImpl::AddThreadId(char* trace_message) const { |
79 uint32_t thread_id = ThreadWrapper::GetThreadId(); | 79 uint32_t thread_id = PlatformThread::GetThreadId(); |
80 // Messages is 12 characters. | 80 // Messages is 12 characters. |
81 return sprintf(trace_message, "%10u; ", thread_id); | 81 return sprintf(trace_message, "%10u; ", thread_id); |
82 } | 82 } |
83 | 83 |
84 int32_t TraceImpl::AddLevel(char* sz_message, const TraceLevel level) const { | 84 int32_t TraceImpl::AddLevel(char* sz_message, const TraceLevel level) const { |
85 const int kMessageLength = 12; | 85 const int kMessageLength = 12; |
86 switch (level) { | 86 switch (level) { |
87 case kTraceTerseInfo: | 87 case kTraceTerseInfo: |
88 // Add the appropriate amount of whitespace. | 88 // Add the appropriate amount of whitespace. |
89 memset(sz_message, ' ', kMessageLength); | 89 memset(sz_message, ' ', kMessageLength); |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 va_end(args); | 595 va_end(args); |
596 buff = temp_buff; | 596 buff = temp_buff; |
597 } | 597 } |
598 trace->AddImpl(level, module, id, buff); | 598 trace->AddImpl(level, module, id, buff); |
599 } | 599 } |
600 ReturnTrace(); | 600 ReturnTrace(); |
601 } | 601 } |
602 } | 602 } |
603 | 603 |
604 } // namespace webrtc | 604 } // namespace webrtc |
OLD | NEW |