OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file overrides the logging macros in libjingle (talk/base/logging.h). | 5 // This file overrides the logging macros in libjingle (talk/base/logging.h). |
6 // Instead of using libjingle's logging implementation, the libjingle macros are | 6 // Instead of using libjingle's logging implementation, the libjingle macros are |
7 // mapped to the corresponding base/logging.h macro (chromium's VLOG). | 7 // mapped to the corresponding base/logging.h macro (chromium's VLOG). |
8 // If this file is included outside of libjingle (e.g. in wrapper code) it | 8 // If this file is included outside of libjingle (e.g. in wrapper code) it |
9 // should be included after base/logging.h (if any) or compiler error or | 9 // should be included after base/logging.h (if any) or compiler error or |
10 // unexpected behavior may occur (macros that have the same name in libjingle as | 10 // unexpected behavior may occur (macros that have the same name in libjingle as |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 #define DIAGNOSTIC_LOG(sev) \ | 181 #define DIAGNOSTIC_LOG(sev) \ |
182 talk_base::DiagnosticLogMessage( \ | 182 talk_base::DiagnosticLogMessage( \ |
183 __FILE__, __LINE__, sev, VLOG_IS_ON(sev)).stream() | 183 __FILE__, __LINE__, sev, VLOG_IS_ON(sev)).stream() |
184 | 184 |
185 #define LOG_CHECK_LEVEL(sev) VLOG_IS_ON(talk_base::sev) | 185 #define LOG_CHECK_LEVEL(sev) VLOG_IS_ON(talk_base::sev) |
186 #define LOG_CHECK_LEVEL_V(sev) VLOG_IS_ON(sev) | 186 #define LOG_CHECK_LEVEL_V(sev) VLOG_IS_ON(sev) |
187 | 187 |
188 #define LOG_V(sev) VLOG(sev) | 188 #define LOG_V(sev) VLOG(sev) |
189 #undef LOG | 189 #undef LOG |
190 #define LOG(sev) LOG_V(talk_base::sev) | 190 // TODO(grunell): Revert change. Only for testing. |
| 191 //#define LOG(sev) LOG_V(talk_base::sev) |
| 192 #define LOG(sev) DIAGNOSTIC_LOG(talk_base::sev) |
191 | 193 |
192 // The _F version prefixes the message with the current function name. | 194 // The _F version prefixes the message with the current function name. |
193 #if defined(__GNUC__) && defined(_DEBUG) | 195 #if defined(__GNUC__) && defined(_DEBUG) |
194 #define LOG_F(sev) LOG(sev) << __PRETTY_FUNCTION__ << ": " | 196 #define LOG_F(sev) LOG(sev) << __PRETTY_FUNCTION__ << ": " |
195 #else | 197 #else |
196 #define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": " | 198 #define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": " |
197 #endif | 199 #endif |
198 | 200 |
199 // This macro wrapps the LAZY_STREAM macro from base/logging.h but flips the | 201 // This macro wrapps the LAZY_STREAM macro from base/logging.h but flips the |
200 // order of the parameters. This is necessary since some compilers will fail | 202 // order of the parameters. This is necessary since some compilers will fail |
(...skipping 25 matching lines...) Expand all Loading... |
226 #define LOG_ERR(sev) LOG_ERRNO(sev) | 228 #define LOG_ERR(sev) LOG_ERRNO(sev) |
227 #define LAST_SYSTEM_ERROR (errno) | 229 #define LAST_SYSTEM_ERROR (errno) |
228 #endif // OS_WIN | 230 #endif // OS_WIN |
229 | 231 |
230 #undef PLOG | 232 #undef PLOG |
231 #define PLOG(sev, err) LOG_ERR_EX(sev, err) | 233 #define PLOG(sev, err) LOG_ERR_EX(sev, err) |
232 | 234 |
233 #endif // LOGGING_INSIDE_LIBJINGLE | 235 #endif // LOGGING_INSIDE_LIBJINGLE |
234 | 236 |
235 #endif // THIRD_PARTY_LIBJINGLE_OVERRIDES_TALK_BASE_LOGGING_H_ | 237 #endif // THIRD_PARTY_LIBJINGLE_OVERRIDES_TALK_BASE_LOGGING_H_ |
OLD | NEW |