blob: b4c369654daa25754301e0995c6306ea4a6f9ea8 [file] [log] [blame]
Brian Silvermand6974f42014-02-14 13:39:21 -08001#include "aos/common/logging/logging_impl.h"
2
3#include <functional>
4
5namespace aos {
6namespace logging {
7
8template <class T>
9void DoLogStruct(log_level level, const ::std::string &message,
10 const T &structure) {
Austin Schuh41d709b2015-11-21 22:38:46 -080011 auto fn = [&structure](char *buffer)
12 -> size_t { return structure.Serialize(buffer); };
13
Brian Silvermand6974f42014-02-14 13:39:21 -080014 LogImplementation::DoLogStruct(level, message, T::Size(), T::GetType(),
Austin Schuh41d709b2015-11-21 22:38:46 -080015 ::std::ref(fn), 1);
Brian Silvermand6974f42014-02-14 13:39:21 -080016}
17
18} // namespace logging
19} // namespace aos