Index: base/mac/mac_logging.mm |
diff --git a/base/mac/mac_logging.cc b/base/mac/mac_logging.mm |
similarity index 78% |
rename from base/mac/mac_logging.cc |
rename to base/mac/mac_logging.mm |
index e82b0ed5f6c7cbf4e588725acba99bc73ea0a328..381ad30614ea2ae4fbab4b04e1c97224f427d435 100644 |
--- a/base/mac/mac_logging.cc |
+++ b/base/mac/mac_logging.mm |
@@ -3,16 +3,25 @@ |
// found in the LICENSE file. |
#include "base/mac/mac_logging.h" |
-#include "build/build_config.h" |
+ |
+#import <Foundation/Foundation.h> |
#include <iomanip> |
+#include "build/build_config.h" |
+ |
#if !defined(OS_IOS) |
#include <CoreServices/CoreServices.h> |
#endif |
namespace logging { |
+std::string DescriptionFromOSStatus(OSStatus err) { |
+ NSError* error = |
+ [NSError errorWithDomain:NSOSStatusErrorDomain code:err userInfo:nil]; |
+ return error.description.UTF8String; |
Mark Mentovai
2016/03/01 15:27:23
Is the full -description what we want, or do we wa
erikchen
2016/03/01 18:02:00
We want -description.
-description: Error Domain=
|
+} |
+ |
OSStatusLogMessage::OSStatusLogMessage(const char* file_path, |
int line, |
LogSeverity severity, |
@@ -28,7 +37,7 @@ OSStatusLogMessage::~OSStatusLogMessage() { |
stream() << ": " << status_; |
#else |
stream() << ": " |
- << GetMacOSStatusErrorString(status_) |
+ << DescriptionFromOSStatus(status_) |
<< " (" |
<< status_ |
<< ")"; |