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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 private: | 113 private: |
114 const char* file_name_; | 114 const char* file_name_; |
115 const int line_; | 115 const int line_; |
116 const LoggingSeverity severity_; | 116 const LoggingSeverity severity_; |
117 const bool log_to_chrome_; | 117 const bool log_to_chrome_; |
118 | 118 |
119 std::string extra_; | 119 std::string extra_; |
120 | 120 |
121 std::ostringstream print_stream_; | 121 std::ostringstream print_stream_; |
122 std::ostringstream print_stream_with_timestamp_; | |
123 }; | 122 }; |
124 | 123 |
125 // This class is used to explicitly ignore values in the conditional | 124 // This class is used to explicitly ignore values in the conditional |
126 // logging macros. This avoids compiler warnings like "value computed | 125 // logging macros. This avoids compiler warnings like "value computed |
127 // is not used" and "statement has no effect". | 126 // is not used" and "statement has no effect". |
128 class LogMessageVoidify { | 127 class LogMessageVoidify { |
129 public: | 128 public: |
130 LogMessageVoidify() { } | 129 LogMessageVoidify() { } |
131 // This has to be an operator with a precedence lower than << but | 130 // This has to be an operator with a precedence lower than << but |
132 // higher than ?: | 131 // higher than ?: |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 #define LOG_ERR(sev) LOG_ERRNO(sev) | 206 #define LOG_ERR(sev) LOG_ERRNO(sev) |
208 #define LAST_SYSTEM_ERROR (errno) | 207 #define LAST_SYSTEM_ERROR (errno) |
209 #endif // OS_WIN | 208 #endif // OS_WIN |
210 | 209 |
211 #undef PLOG | 210 #undef PLOG |
212 #define PLOG(sev, err) LOG_ERR_EX(sev, err) | 211 #define PLOG(sev, err) LOG_ERR_EX(sev, err) |
213 | 212 |
214 #endif // LOGGING_INSIDE_LIBJINGLE | 213 #endif // LOGGING_INSIDE_LIBJINGLE |
215 | 214 |
216 #endif // THIRD_PARTY_LIBJINGLE_OVERRIDES_TALK_BASE_LOGGING_H_ | 215 #endif // THIRD_PARTY_LIBJINGLE_OVERRIDES_TALK_BASE_LOGGING_H_ |
OLD | NEW |