6#ifndef MSGPACK_DEFINE_MAP
7#define MSGPACK_DEFINE_MAP(...)
21 std::uint64_t time_ms = 0;
25 : level_(level), time_ms(time_ms), message_(message) {}
27 MSGPACK_NVP(
"m", message_))
36 unsigned int member_id = 0;
37 std::shared_ptr<std::deque<LogLine>>
log;
40 const std::shared_ptr<std::deque<LogLine>> &log)
41 : member_id(member_id), log(log) {}
42 template <
typename It>
43 LogDefault(
const It &begin,
const It &end) : member_id(0) {
44 this->log = std::make_shared<std::deque<LogLine>>();
45 for (
auto it = begin; it < end; it++) {
46 if constexpr (std::is_same_v<
decltype(*it),
LogLine>) {
47 this->log->push_back(*it);
49 this->log->emplace_back(it->toMessage());
54 this->log = std::make_shared<std::deque<LogLine>>(1);
55 this->log->front() = ll;
64 std::shared_ptr<std::deque<LogLine>>
log;
67 const std::shared_ptr<std::deque<LogLine>> &log)
68 : field(field), log(log) {}
69 template <
typename It>
72 this->log = std::make_shared<std::deque<LogLine>>();
73 for (
auto it = begin; it < end; it++) {
74 if constexpr (std::is_same_v<
decltype(*it),
LogLine>) {
75 this->log->push_back(*it);
77 this->log->emplace_back(it->toMessage());
82 this->log = std::make_shared<std::deque<LogLine>>(1);
83 this->log->front() = ll;
92 unsigned int member_id = 0;
97 unsigned int req_id = 0;
99 std::shared_ptr<std::deque<LogLine>>
log;
102 const std::shared_ptr<std::deque<LogLine>> &log)
103 :
MessageBase<MessageKind::log + MessageKind::res>(), req_id(req_id),
104 sub_field(sub_field), log(log) {}
105 template <
typename It>
108 :
MessageBase<MessageKind::log + MessageKind::res>(), req_id(req_id),
109 sub_field(sub_field) {
110 this->log = std::make_shared<std::deque<LogLine>>();
111 for (
auto it = begin; it < end; it++) {
112 if constexpr (std::is_same_v<
decltype(*it),
LogLine>) {
113 this->log->push_back(*it);
115 this->log->emplace_back(it->toMessage());
121 MSGPACK_NVP(
"l", log))
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:69
#define MSGPACK_DEFINE_MAP(...)
Definition canvas2d.h:10
client(member)->server->client logを追加
Definition log.h:35
LogDefault(unsigned int member_id, const std::shared_ptr< std::deque< LogLine > > &log)
Definition log.h:39
LogDefault(const LogLine &ll)
Definition log.h:53
std::shared_ptr< std::deque< LogLine > > log
Definition log.h:37
LogDefault(const It &begin, const It &end)
Definition log.h:43
LogLine(int level, std::uint64_t time_ms, const SharedString &message)
Definition log.h:24
SharedString message_
Definition log.h:22
SharedString member
Definition log.h:88
Log(const SharedString &field, const LogLine &ll)
Definition log.h:81
Log(const SharedString &field, const std::shared_ptr< std::deque< LogLine > > &log)
Definition log.h:66
SharedString field
Definition log.h:63
std::shared_ptr< std::deque< LogLine > > log
Definition log.h:64
Log(const SharedString &field, const It &begin, const It &end)
Definition log.h:70
型からkindを取得するためだけのベースクラス
Definition base.h:53
Res(unsigned int req_id, const SharedString &sub_field, const std::shared_ptr< std::deque< LogLine > > &log)
Definition log.h:101
Res(unsigned int req_id, const SharedString &sub_field, const It &begin, const It &end)
Definition log.h:106
SharedString sub_field
Definition log.h:98
std::shared_ptr< std::deque< LogLine > > log
Definition log.h:99
#define WEBCFACE_NS_END
Definition webcface-config.h:104
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:103