userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
json.cpp
1
#
include
<
google
/
protobuf
/
json
/
json
.
h
>
2
#
include
<
google
/
protobuf
/
message
.
h
>
3
4
#
include
<
userver
/
proto
-
structs
/
json
.
hpp
>
5
#
include
<
userver
/
protobuf
/
string
.
hpp
>
6
7
USERVER_NAMESPACE_BEGIN
8
9
namespace
logging
::impl {
10
11
logging::LogHelper& LogMessage(logging::LogHelper& h,
const
google::protobuf::Message& message) {
12
auto
options = google::protobuf::json::PrintOptions();
13
options.always_print_primitive_fields =
true
;
14
options.preserve_proto_field_names =
true
;
15
16
protobuf::ProtoStringType out;
17
const
auto
status = google::protobuf::json::MessageToJsonString(message, &out, options);
18
if
(status.ok()) {
19
return
h << out;
20
}
21
return
h <<
"Failed to log struct: "
<< status;
22
}
23
24
}
// namespace logging::impl
25
26
USERVER_NAMESPACE_END
proto-structs
src
proto-structs
json.cpp
Generated on
for userver by
Doxygen
1.17.0