Brian Silverman | d6974f4 | 2014-02-14 13:39:21 -0800 | [diff] [blame^] | 1 | #include "aos/common/logging/logging_impl.h" |
2 | |||||
3 | #include <functional> | ||||
4 | |||||
5 | namespace aos { | ||||
6 | namespace logging { | ||||
7 | |||||
8 | template <class T> | ||||
9 | void DoLogStruct(log_level level, const ::std::string &message, | ||||
10 | const T &structure) { | ||||
11 | LogImplementation::DoLogStruct(level, message, T::Size(), T::GetType(), | ||||
12 | [&structure](char * buffer)->size_t{ | ||||
13 | return structure.Serialize(buffer); | ||||
14 | }, | ||||
15 | 1); | ||||
16 | } | ||||
17 | |||||
18 | } // namespace logging | ||||
19 | } // namespace aos |