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

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

Issue 278923002: Use the new ScopedMachVM class and the MACH_LOG family of logging macros (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') | base/memory/discardable_memory_mac.cc » ('J')
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/logging.h" 8 #include "base/logging.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 25 matching lines...) Expand all
36 ~OSStatusLogMessage(); 36 ~OSStatusLogMessage();
37 37
38 private: 38 private:
39 OSStatus status_; 39 OSStatus status_;
40 40
41 DISALLOW_COPY_AND_ASSIGN(OSStatusLogMessage); 41 DISALLOW_COPY_AND_ASSIGN(OSStatusLogMessage);
42 }; 42 };
43 43
44 } // namespace logging 44 } // namespace logging
45 45
46 #if defined(NDEBUG)
47 #define MAC_DVLOG_IS_ON(verbose_level) 0
48 #else
49 #define MAC_DVLOG_IS_ON(verbose_level) VLOG_IS_ON(verbose_level)
50 #endif
51
46 #define OSSTATUS_LOG_STREAM(severity, status) \ 52 #define OSSTATUS_LOG_STREAM(severity, status) \
47 COMPACT_GOOGLE_LOG_EX_ ## severity(OSStatusLogMessage, status).stream() 53 COMPACT_GOOGLE_LOG_EX_ ## severity(OSStatusLogMessage, status).stream()
48 #define OSSTATUS_VLOG_STREAM(verbose_level, status) \ 54 #define OSSTATUS_VLOG_STREAM(verbose_level, status) \
49 logging::OSStatusLogMessage(__FILE__, __LINE__, \ 55 logging::OSStatusLogMessage(__FILE__, __LINE__, \
50 -verbose_level, status).stream() 56 -verbose_level, status).stream()
51 57
52 #define OSSTATUS_LOG(severity, status) \ 58 #define OSSTATUS_LOG(severity, status) \
53 LAZY_STREAM(OSSTATUS_LOG_STREAM(severity, status), LOG_IS_ON(severity)) 59 LAZY_STREAM(OSSTATUS_LOG_STREAM(severity, status), LOG_IS_ON(severity))
54 #define OSSTATUS_LOG_IF(severity, condition, status) \ 60 #define OSSTATUS_LOG_IF(severity, condition, status) \
55 LAZY_STREAM(OSSTATUS_LOG_STREAM(severity, status), \ 61 LAZY_STREAM(OSSTATUS_LOG_STREAM(severity, status), \
(...skipping 11 matching lines...) Expand all
67 << "Check failed: " # condition << ". " 73 << "Check failed: " # condition << ". "
68 74
69 #define OSSTATUS_DLOG(severity, status) \ 75 #define OSSTATUS_DLOG(severity, status) \
70 LAZY_STREAM(OSSTATUS_LOG_STREAM(severity, status), DLOG_IS_ON(severity)) 76 LAZY_STREAM(OSSTATUS_LOG_STREAM(severity, status), DLOG_IS_ON(severity))
71 #define OSSTATUS_DLOG_IF(severity, condition, status) \ 77 #define OSSTATUS_DLOG_IF(severity, condition, status) \
72 LAZY_STREAM(OSSTATUS_LOG_STREAM(severity, status), \ 78 LAZY_STREAM(OSSTATUS_LOG_STREAM(severity, status), \
73 DLOG_IS_ON(severity) && (condition)) 79 DLOG_IS_ON(severity) && (condition))
74 80
75 #define OSSTATUS_DVLOG(verbose_level, status) \ 81 #define OSSTATUS_DVLOG(verbose_level, status) \
76 LAZY_STREAM(OSSTATUS_VLOG_STREAM(verbose_level, status), \ 82 LAZY_STREAM(OSSTATUS_VLOG_STREAM(verbose_level, status), \
77 DVLOG_IS_ON(verbose_level)) 83 MAC_DVLOG_IS_ON(verbose_level))
78 #define OSSTATUS_DVLOG_IF(verbose_level, condition, status) \ 84 #define OSSTATUS_DVLOG_IF(verbose_level, condition, status) \
79 LAZY_STREAM(OSSTATUS_VLOG_STREAM(verbose_level, status) \ 85 LAZY_STREAM(OSSTATUS_VLOG_STREAM(verbose_level, status), \
80 DVLOG_IS_ON(verbose_level) && (condition)) 86 MAC_DVLOG_IS_ON(verbose_level) && (condition))
81 87
82 #define OSSTATUS_DCHECK(condition, status) \ 88 #define OSSTATUS_DCHECK(condition, status) \
83 LAZY_STREAM(OSSTATUS_LOG_STREAM(FATAL, status), \ 89 LAZY_STREAM(OSSTATUS_LOG_STREAM(FATAL, status), \
84 DCHECK_IS_ON && !(condition)) \ 90 DCHECK_IS_ON && !(condition)) \
85 << "Check failed: " # condition << ". " 91 << "Check failed: " # condition << ". "
86 92
87 #endif // BASE_MAC_MAC_LOGGING_H_ 93 #endif // BASE_MAC_MAC_LOGGING_H_
OLDNEW
« no previous file with comments | « no previous file | base/mac/mach_logging.h » ('j') | base/memory/discardable_memory_mac.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698