blob: c2c1018f27dc1c64806c8b7a28addd2b5414c6c8 [file] [log] [blame]
Yong Hongf4872de2019-01-30 19:04:18 +08001/* Copyright 2019 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 HARDWARE_VERIFIER_LOG_UTILS_H_
7#define HARDWARE_VERIFIER_LOG_UTILS_H_
8
9#include <string>
10
11#include <base/logging.h>
12#include <google/protobuf/message.h>
13
14namespace hardware_verifier {
15
16// A helper function to dump the given protobuf message.
17inline void VLogProtobuf(int verbosity,
18 const std::string& msg_name,
19 const google::protobuf::Message& msg) {
20 VLOG(verbosity) << "<--- Begin: dump of |" << msg_name << "|\n\n"
21 << msg.DebugString() << "\n<--- End.";
22}
23
24} // namespace hardware_verifier
25
26#endif // HARDWARE_VERIFIER_LOG_UTILS_H_