1/* Copyright 2016 The Chromium OS 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
6#ifndef INCLUDE_ARC_COMMON_H_
7#define INCLUDE_ARC_COMMON_H_
8
9#include <string>
10
11#include <base/logging.h>
12
13#define LOGF(level) LOG(level) << __FUNCTION__ << "(): "
14#define LOGFID(level, id) LOG(level) << __FUNCTION__ << "(): id: " << id << ": "
15#define LOGF_IF(level, res) LOG_IF(level, res) << __FUNCTION__ << "(): "
16
17#define VLOGF(level) VLOG(level) << __FUNCTION__ << "(): "
18#define VLOGFID(level, id) \
19  VLOG(level) << __FUNCTION__ << "(): id: " << id << ": "
20
21#define VLOGF_ENTER() VLOGF(1) << "enter"
22#define VLOGF_EXIT() VLOGF(1) << "exit"
23
24inline std::string FormatToString(int32_t format) {
25  return std::string(reinterpret_cast<char*>(&format), 4);
26}
27
28#endif  // INCLUDE_ARC_COMMON_H_
29