OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "base/mac/mac_logging.h" | |
6 #include "build/build_config.h" | |
7 | |
8 #include <iomanip> | |
9 | |
10 #if !defined(OS_IOS) | |
11 #include <CoreServices/CoreServices.h> | |
12 #endif | |
13 | |
14 namespace logging { | |
15 | |
16 OSStatusLogMessage::OSStatusLogMessage(const char* file_path, | |
17 int line, | |
18 LogSeverity severity, | |
19 OSStatus status) | |
20 : LogMessage(file_path, line, severity), | |
21 status_(status) { | |
22 } | |
23 | |
24 OSStatusLogMessage::~OSStatusLogMessage() { | |
25 #if defined(OS_IOS) | |
26 // TODO(ios): Consider using NSError with NSOSStatusErrorDomain to try to | |
27 // get a description of the failure. | |
28 stream() << ": " << status_; | |
29 #else | |
30 stream() << ": " | |
31 << GetMacOSStatusErrorString(status_) | |
32 << " (" | |
33 << status_ | |
34 << ")"; | |
35 #endif | |
36 } | |
37 | |
38 } // namespace logging | |
OLD | NEW |