128e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan/* Copyright 2016 The Chromium OS Authors. All rights reserved. 228e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan * Use of this source code is governed by a BSD-style license that can be 328e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan * found in the LICENSE file. 428e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan */ 528e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan 628e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan#ifndef INCLUDE_ARC_COMMON_H_ 728e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan#define INCLUDE_ARC_COMMON_H_ 828e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan 928e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan#include <string> 1028e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan 1128e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan#include <base/logging.h> 1228e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan 1328e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan#define LOGF(level) LOG(level) << __FUNCTION__ << "(): " 1428e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan#define LOGFID(level, id) LOG(level) << __FUNCTION__ << "(): id: " << id << ": " 1528e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan#define LOGF_IF(level, res) LOG_IF(level, res) << __FUNCTION__ << "(): " 1628e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan 1728e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan#define VLOGF(level) VLOG(level) << __FUNCTION__ << "(): " 1828e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan#define VLOGFID(level, id) \ 1928e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan VLOG(level) << __FUNCTION__ << "(): id: " << id << ": " 2028e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan 2128e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan#define VLOGF_ENTER() VLOGF(1) << "enter" 2228e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan#define VLOGF_EXIT() VLOGF(1) << "exit" 2328e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan 2428e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathaninline std::string FormatToString(int32_t format) { 2528e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan return std::string(reinterpret_cast<char*>(&format), 4); 2628e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan} 2728e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan 2828e0f76353e06b24b7dae54e636dbb5ddc64d1a5Prashanth Swaminathan#endif // INCLUDE_ARC_COMMON_H_ 29