OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_SYNC_UTIL_LOGGING_H_ | 5 #ifndef CHROME_BROWSER_SYNC_UTIL_LOGGING_H_ |
6 #define CHROME_BROWSER_SYNC_UTIL_LOGGING_H_ | 6 #define CHROME_BROWSER_SYNC_UTIL_LOGGING_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
11 // TODO(akalin): This probably belongs in base/ somewhere. | 11 // TODO(akalin): This probably belongs in base/ somewhere. |
12 | 12 |
13 namespace tracked_objects { | 13 namespace tracked_objects { |
14 class Location; | 14 class Location; |
15 } // namespace tracked_objects | 15 } // namespace tracked_objects |
16 | 16 |
17 namespace browser_sync { | 17 namespace browser_sync { |
18 | 18 |
19 bool VlogIsOnForLocation(const tracked_objects::Location& from_here, | 19 bool VlogIsOnForLocation(const tracked_objects::Location& from_here, |
20 int verbose_level); | 20 int verbose_level); |
21 | 21 |
22 } // namespace browser_sync | 22 } // namespace browser_sync |
23 | 23 |
24 #define VLOG_LOC_STREAM(from_here, verbose_level) \ | 24 #define VLOG_LOC_STREAM(from_here, verbose_level) \ |
25 logging::LogMessage(from_here.file_name(), from_here.line_number(), \ | 25 logging::LogMessage(from_here.file_name().as_string().c_str(), \ |
jar (doing other things)
2011/09/01 18:17:51
I'm not clear on how often this logging is done...
jbates
2011/09/01 23:01:52
I agree if this is common we should add StringPiec
| |
26 from_here.line_number(), \ | |
26 -verbose_level).stream() | 27 -verbose_level).stream() |
27 | 28 |
28 #define VLOG_LOC(from_here, verbose_level) \ | 29 #define VLOG_LOC(from_here, verbose_level) \ |
29 LAZY_STREAM( \ | 30 LAZY_STREAM( \ |
30 VLOG_LOC_STREAM(from_here, verbose_level), \ | 31 VLOG_LOC_STREAM(from_here, verbose_level), \ |
31 VLOG_IS_ON(verbose_level) || \ | 32 VLOG_IS_ON(verbose_level) || \ |
32 ::browser_sync::VlogIsOnForLocation(from_here, verbose_level)) | 33 ::browser_sync::VlogIsOnForLocation(from_here, verbose_level)) |
33 | 34 |
34 #endif // CHROME_BROWSER_SYNC_UTIL_LOGGING_H_ | 35 #endif // CHROME_BROWSER_SYNC_UTIL_LOGGING_H_ |
OLD | NEW |