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

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

Issue 1753523002: Use a non-deprecated method to get a string from an OSStatus error . (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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" 8 #include "base/base_export.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 11 matching lines...) Expand all
22 // global (or thread-local) OSStatus or OSErr value, the specific error must 22 // global (or thread-local) OSStatus or OSErr value, the specific error must
23 // be supplied as an argument to the OSSTATUS_LOG macro. The message logged 23 // be supplied as an argument to the OSSTATUS_LOG macro. The message logged
24 // will contain the symbolic constant name corresponding to the status value, 24 // will contain the symbolic constant name corresponding to the status value,
25 // along with the value itself. 25 // along with the value itself.
26 // 26 //
27 // OSErr is just an older 16-bit form of the newer 32-bit OSStatus. Despite 27 // OSErr is just an older 16-bit form of the newer 32-bit OSStatus. Despite
28 // the name, OSSTATUS_LOG can be used equally well for OSStatus and OSErr. 28 // the name, OSSTATUS_LOG can be used equally well for OSStatus and OSErr.
29 29
30 namespace logging { 30 namespace logging {
31 31
32 // Returns a UTF8 description from an OS X Status error.
33 BASE_EXPORT std::string DescriptionFromOSStatus(OSStatus err);
34
32 class BASE_EXPORT OSStatusLogMessage : public logging::LogMessage { 35 class BASE_EXPORT OSStatusLogMessage : public logging::LogMessage {
33 public: 36 public:
34 OSStatusLogMessage(const char* file_path, 37 OSStatusLogMessage(const char* file_path,
35 int line, 38 int line,
36 LogSeverity severity, 39 LogSeverity severity,
37 OSStatus status); 40 OSStatus status);
38 ~OSStatusLogMessage(); 41 ~OSStatusLogMessage();
39 42
40 private: 43 private:
41 OSStatus status_; 44 OSStatus status_;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 #define OSSTATUS_DVLOG_IF(verbose_level, condition, status) \ 89 #define OSSTATUS_DVLOG_IF(verbose_level, condition, status) \
87 LAZY_STREAM(OSSTATUS_VLOG_STREAM(verbose_level, status), \ 90 LAZY_STREAM(OSSTATUS_VLOG_STREAM(verbose_level, status), \
88 MAC_DVLOG_IS_ON(verbose_level) && (condition)) 91 MAC_DVLOG_IS_ON(verbose_level) && (condition))
89 92
90 #define OSSTATUS_DCHECK(condition, status) \ 93 #define OSSTATUS_DCHECK(condition, status) \
91 LAZY_STREAM(OSSTATUS_LOG_STREAM(FATAL, status), \ 94 LAZY_STREAM(OSSTATUS_LOG_STREAM(FATAL, status), \
92 DCHECK_IS_ON() && !(condition)) \ 95 DCHECK_IS_ON() && !(condition)) \
93 << "Check failed: " #condition << ". " 96 << "Check failed: " #condition << ". "
94 97
95 #endif // BASE_MAC_MAC_LOGGING_H_ 98 #endif // BASE_MAC_MAC_LOGGING_H_
OLDNEW
« no previous file with comments | « base/base.gypi ('k') | base/mac/mac_logging.cc » ('j') | base/mac/mac_logging.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698