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 * System independent wrapper for logging runtime information to file. | 10 * System independent wrapper for logging runtime information to file. |
11 * Note: All log messages will be written to the same trace file. | 11 * Note: All log messages will be written to the same trace file. |
12 * Note: If too many messages are written to file there will be a build up of | 12 * Note: If too many messages are written to file there will be a build up of |
13 * messages. Apply filtering to avoid that. | 13 * messages. Apply filtering to avoid that. |
14 */ | 14 */ |
15 | 15 |
16 #ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_TRACE_H_ | 16 #ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_TRACE_H_ |
17 #define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_TRACE_H_ | 17 #define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_TRACE_H_ |
18 | 18 |
| 19 #include "webrtc/base/atomicops.h" |
19 #include "webrtc/common_types.h" | 20 #include "webrtc/common_types.h" |
20 #include "webrtc/typedefs.h" | 21 #include "webrtc/typedefs.h" |
21 | 22 |
22 namespace webrtc { | 23 namespace webrtc { |
23 | 24 |
24 #if defined(WEBRTC_RESTRICT_LOGGING) | 25 #if defined(WEBRTC_RESTRICT_LOGGING) |
25 // Disable all TRACE macros. The LOG macro is still functional. | 26 // Disable all TRACE macros. The LOG macro is still functional. |
26 #define WEBRTC_TRACE true ? (void) 0 : Trace::Add | 27 #define WEBRTC_TRACE true ? (void) 0 : Trace::Add |
27 #else | 28 #else |
28 #define WEBRTC_TRACE Trace::Add | 29 #define WEBRTC_TRACE Trace::Add |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // id is an identifier that should be unique for that set of classes that | 78 // id is an identifier that should be unique for that set of classes that |
78 // are associated (e.g. all instances owned by an engine). | 79 // are associated (e.g. all instances owned by an engine). |
79 // msg and the ellipsis are the same as e.g. sprintf. | 80 // msg and the ellipsis are the same as e.g. sprintf. |
80 // TODO(hellner) Why is TraceModule not defined in this file? | 81 // TODO(hellner) Why is TraceModule not defined in this file? |
81 static void Add(const TraceLevel level, | 82 static void Add(const TraceLevel level, |
82 const TraceModule module, | 83 const TraceModule module, |
83 const int32_t id, | 84 const int32_t id, |
84 const char* msg, ...); | 85 const char* msg, ...); |
85 | 86 |
86 private: | 87 private: |
87 static volatile int level_filter_; | 88 static rtc::AtomicInt level_filter_; |
88 }; | 89 }; |
89 | 90 |
90 } // namespace webrtc | 91 } // namespace webrtc |
91 | 92 |
92 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_TRACE_H_ | 93 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_TRACE_H_ |
OLD | NEW |