OLD | NEW |
1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_SYNC_UTIL_LOGGING_H_ | 5 #ifndef SYNC_UTIL_LOGGING_H_ |
6 #define CHROME_BROWSER_SYNC_UTIL_LOGGING_H_ | 6 #define 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(), from_here.line_number(), \ |
26 -verbose_level).stream() | 26 -verbose_level).stream() |
27 | 27 |
28 #define DVLOG_LOC(from_here, verbose_level) \ | 28 #define DVLOG_LOC(from_here, verbose_level) \ |
29 LAZY_STREAM( \ | 29 LAZY_STREAM( \ |
30 VLOG_LOC_STREAM(from_here, verbose_level), \ | 30 VLOG_LOC_STREAM(from_here, verbose_level), \ |
31 ::logging::DEBUG_MODE && \ | 31 ::logging::DEBUG_MODE && \ |
32 (VLOG_IS_ON(verbose_level) || \ | 32 (VLOG_IS_ON(verbose_level) || \ |
33 ::browser_sync::VlogIsOnForLocation(from_here, verbose_level))) \ | 33 ::browser_sync::VlogIsOnForLocation(from_here, verbose_level))) \ |
34 | 34 |
35 #endif // CHROME_BROWSER_SYNC_UTIL_LOGGING_H_ | 35 #endif // SYNC_UTIL_LOGGING_H_ |
OLD | NEW |