Upload upstream chromium 76.0.3809.146
[platform/framework/web/chromium-efl.git] / base / fuchsia / fuchsia_logging.cc
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 namespace logging {
12
13 ZxLogMessage::ZxLogMessage(const char* file_path,
14                            int line,
15                            LogSeverity severity,
16                            zx_status_t zx_err)
17     : LogMessage(file_path, line, severity), zx_err_(zx_err) {}
18
19 ZxLogMessage::~ZxLogMessage() {
20   // zx_status_t error values are negative, so log the numeric version as
21   // decimal rather than hex. This is also useful to match zircon/errors.h for
22   // grepping.
23   stream() << ": " << zx_status_get_string(zx_err_) << " (" << zx_err_ << ")";
24 }
25
26 }  // namespace logging