Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 1 | // Copyright 2017 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/fuchsia/fuchsia_logging.h" |
| 6 | |
| 7 | #include <zircon/status.h> |
| 8 | |
| 9 | #include <iomanip> |
| 10 | |
| 11 | #include "starboard/types.h" |
| 12 | |
| 13 | namespace logging { |
| 14 | |
| 15 | ZxLogMessage::ZxLogMessage(const char* file_path, |
| 16 | int line, |
| 17 | LogSeverity severity, |
| 18 | zx_status_t zx_err) |
| 19 | : LogMessage(file_path, line, severity), zx_err_(zx_err) {} |
| 20 | |
| 21 | ZxLogMessage::~ZxLogMessage() { |
| 22 | // zx_status_t error values are negative, so log the numeric version as |
| 23 | // decimal rather than hex. This is also useful to match zircon/errors.h for |
| 24 | // grepping. |
| 25 | stream() << ": " << zx_status_get_string(zx_err_) << " (" << zx_err_ << ")"; |
| 26 | } |
| 27 | |
| 28 | } // namespace logging |