1 //
2 // Copyright(c) 2015 Gabi Melman.
3 // Distributed under the MIT License (http://opensource.org/licenses/MIT)
4 //
5 
6 #pragma once
7 
8 #include "spdlog/common.h"
9 #include "spdlog/details/os.h"
10 
11 
12 #include <string>
13 #include <utility>
14 
15 namespace spdlog
16 {
17 namespace details
18 {
19 struct log_msg
20 {
21     log_msg() = default;
log_msgspdlog::details::log_msg22     log_msg(const std::string *loggers_name, level::level_enum lvl) :
23         logger_name(loggers_name),
24         level(lvl),
25         msg_id(0)
26     {
27 #ifndef SPDLOG_NO_DATETIME
28         time = os::now();
29 #endif
30 
31 #ifndef SPDLOG_NO_THREAD_ID
32         thread_id = os::thread_id();
33 #endif
34     }
35 
36     log_msg(const log_msg& other)  = delete;
37     log_msg& operator=(log_msg&& other) = delete;
38     log_msg(log_msg&& other) = delete;
39 
40 
41     const std::string *logger_name;
42     level::level_enum level;
43     log_clock::time_point time;
44     size_t thread_id;
45     fmt::MemoryWriter raw;
46     fmt::MemoryWriter formatted;
47     size_t msg_id;
48 };
49 }
50 }
51