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" | |
20 #include "webrtc/common_types.h" | 19 #include "webrtc/common_types.h" |
21 #include "webrtc/typedefs.h" | 20 #include "webrtc/typedefs.h" |
22 | 21 |
23 namespace webrtc { | 22 namespace webrtc { |
24 | 23 |
25 #if defined(WEBRTC_RESTRICT_LOGGING) | 24 #if defined(WEBRTC_RESTRICT_LOGGING) |
26 // Disable all TRACE macros. The LOG macro is still functional. | 25 // Disable all TRACE macros. The LOG macro is still functional. |
27 #define WEBRTC_TRACE true ? (void) 0 : Trace::Add | 26 #define WEBRTC_TRACE true ? (void) 0 : Trace::Add |
28 #else | 27 #else |
29 #define WEBRTC_TRACE Trace::Add | 28 #define WEBRTC_TRACE Trace::Add |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // id is an identifier that should be unique for that set of classes that | 77 // id is an identifier that should be unique for that set of classes that |
79 // are associated (e.g. all instances owned by an engine). | 78 // are associated (e.g. all instances owned by an engine). |
80 // msg and the ellipsis are the same as e.g. sprintf. | 79 // msg and the ellipsis are the same as e.g. sprintf. |
81 // TODO(hellner) Why is TraceModule not defined in this file? | 80 // TODO(hellner) Why is TraceModule not defined in this file? |
82 static void Add(const TraceLevel level, | 81 static void Add(const TraceLevel level, |
83 const TraceModule module, | 82 const TraceModule module, |
84 const int32_t id, | 83 const int32_t id, |
85 const char* msg, ...); | 84 const char* msg, ...); |
86 | 85 |
87 private: | 86 private: |
88 static rtc::AtomicInt level_filter_; | 87 static volatile int level_filter_; |
89 }; | 88 }; |
90 | 89 |
91 } // namespace webrtc | 90 } // namespace webrtc |
92 | 91 |
93 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_TRACE_H_ | 92 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_TRACE_H_ |
OLD | NEW |