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