blob: cb901ce54a0468737ed6ebcb56b34ef907f00414 [file] [log] [blame]
Andrew Top0d1858f2019-05-15 22:01:47 -07001// 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
13namespace logging {
14
15ZxLogMessage::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
21ZxLogMessage::~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