Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: base/mac/mac_logging.h

Issue 274193007: Back out r269483 and the line of fixes that followed it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/mac/mach_logging.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef BASE_MAC_MAC_LOGGING_H_ 5 #ifndef BASE_MAC_MAC_LOGGING_H_
6 #define BASE_MAC_MAC_LOGGING_H_ 6 #define BASE_MAC_MAC_LOGGING_H_
7 7
8 #include "base/base_export.h"
9 #include "base/basictypes.h"
10 #include "base/logging.h" 8 #include "base/logging.h"
11 #include "build/build_config.h" 9 #include "build/build_config.h"
12 10
13 #if defined(OS_IOS) 11 #if defined(OS_IOS)
14 #include <MacTypes.h> 12 #include <MacTypes.h>
15 #else 13 #else
16 #include <libkern/OSTypes.h> 14 #include <libkern/OSTypes.h>
17 #endif 15 #endif
18 16
19 // Use the OSSTATUS_LOG family to log messages related to errors in Mac OS X 17 // Use the OSSTATUS_LOG family to log messages related to errors in Mac OS X
(...skipping 18 matching lines...) Expand all
38 ~OSStatusLogMessage(); 36 ~OSStatusLogMessage();
39 37
40 private: 38 private:
41 OSStatus status_; 39 OSStatus status_;
42 40
43 DISALLOW_COPY_AND_ASSIGN(OSStatusLogMessage); 41 DISALLOW_COPY_AND_ASSIGN(OSStatusLogMessage);
44 }; 42 };
45 43
46 } // namespace logging 44 } // namespace logging
47 45
48 #if defined(NDEBUG)
49 #define MAC_DVLOG_IS_ON(verbose_level) 0
50 #else
51 #define MAC_DVLOG_IS_ON(verbose_level) VLOG_IS_ON(verbose_level)
52 #endif
53
54 #define OSSTATUS_LOG_STREAM(severity, status) \ 46 #define OSSTATUS_LOG_STREAM(severity, status) \
55 COMPACT_GOOGLE_LOG_EX_ ## severity(OSStatusLogMessage, status).stream() 47 COMPACT_GOOGLE_LOG_EX_ ## severity(OSStatusLogMessage, status).stream()
56 #define OSSTATUS_VLOG_STREAM(verbose_level, status) \ 48 #define OSSTATUS_VLOG_STREAM(verbose_level, status) \
57 logging::OSStatusLogMessage(__FILE__, __LINE__, \ 49 logging::OSStatusLogMessage(__FILE__, __LINE__, \
58 -verbose_level, status).stream() 50 -verbose_level, status).stream()
59 51
60 #define OSSTATUS_LOG(severity, status) \ 52 #define OSSTATUS_LOG(severity, status) \
61 LAZY_STREAM(OSSTATUS_LOG_STREAM(severity, status), LOG_IS_ON(severity)) 53 LAZY_STREAM(OSSTATUS_LOG_STREAM(severity, status), LOG_IS_ON(severity))
62 #define OSSTATUS_LOG_IF(severity, condition, status) \ 54 #define OSSTATUS_LOG_IF(severity, condition, status) \
63 LAZY_STREAM(OSSTATUS_LOG_STREAM(severity, status), \ 55 LAZY_STREAM(OSSTATUS_LOG_STREAM(severity, status), \
(...skipping 11 matching lines...) Expand all
75 << "Check failed: " # condition << ". " 67 << "Check failed: " # condition << ". "
76 68
77 #define OSSTATUS_DLOG(severity, status) \ 69 #define OSSTATUS_DLOG(severity, status) \
78 LAZY_STREAM(OSSTATUS_LOG_STREAM(severity, status), DLOG_IS_ON(severity)) 70 LAZY_STREAM(OSSTATUS_LOG_STREAM(severity, status), DLOG_IS_ON(severity))
79 #define OSSTATUS_DLOG_IF(severity, condition, status) \ 71 #define OSSTATUS_DLOG_IF(severity, condition, status) \
80 LAZY_STREAM(OSSTATUS_LOG_STREAM(severity, status), \ 72 LAZY_STREAM(OSSTATUS_LOG_STREAM(severity, status), \
81 DLOG_IS_ON(severity) && (condition)) 73 DLOG_IS_ON(severity) && (condition))
82 74
83 #define OSSTATUS_DVLOG(verbose_level, status) \ 75 #define OSSTATUS_DVLOG(verbose_level, status) \
84 LAZY_STREAM(OSSTATUS_VLOG_STREAM(verbose_level, status), \ 76 LAZY_STREAM(OSSTATUS_VLOG_STREAM(verbose_level, status), \
85 MAC_DVLOG_IS_ON(verbose_level)) 77 DVLOG_IS_ON(verbose_level))
86 #define OSSTATUS_DVLOG_IF(verbose_level, condition, status) \ 78 #define OSSTATUS_DVLOG_IF(verbose_level, condition, status) \
87 LAZY_STREAM(OSSTATUS_VLOG_STREAM(verbose_level, status), \ 79 LAZY_STREAM(OSSTATUS_VLOG_STREAM(verbose_level, status) \
88 MAC_DVLOG_IS_ON(verbose_level) && (condition)) 80 DVLOG_IS_ON(verbose_level) && (condition))
89 81
90 #define OSSTATUS_DCHECK(condition, status) \ 82 #define OSSTATUS_DCHECK(condition, status) \
91 LAZY_STREAM(OSSTATUS_LOG_STREAM(FATAL, status), \ 83 LAZY_STREAM(OSSTATUS_LOG_STREAM(FATAL, status), \
92 DCHECK_IS_ON && !(condition)) \ 84 DCHECK_IS_ON && !(condition)) \
93 << "Check failed: " # condition << ". " 85 << "Check failed: " # condition << ". "
94 86
95 #endif // BASE_MAC_MAC_LOGGING_H_ 87 #endif // BASE_MAC_MAC_LOGGING_H_
OLDNEW
« no previous file with comments | « no previous file | base/mac/mach_logging.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698