1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. |
2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) |
3 | |
4 | #pragma once |
5 | |
6 | #include <spdlog/common.h> |
7 | #include <string> |
8 | |
9 | namespace spdlog { |
10 | namespace details { |
11 | struct SPDLOG_API log_msg |
12 | { |
13 | log_msg() = default; |
14 | log_msg(log_clock::time_point log_time, source_loc loc, string_view_t logger_name, level::level_enum lvl, string_view_t msg); |
15 | log_msg(source_loc loc, string_view_t logger_name, level::level_enum lvl, string_view_t msg); |
16 | log_msg(string_view_t logger_name, level::level_enum lvl, string_view_t msg); |
17 | log_msg(const log_msg &other) = default; |
18 | log_msg &operator=(const log_msg &other) = default; |
19 | |
20 | string_view_t logger_name; |
21 | level::level_enum level{level::off}; |
22 | log_clock::time_point time; |
23 | size_t thread_id{0}; |
24 | |
25 | // wrapping the formatted text with color (updated by pattern_formatter). |
26 | mutable size_t color_range_start{0}; |
27 | mutable size_t color_range_end{0}; |
28 | |
29 | source_loc source; |
30 | string_view_t payload; |
31 | }; |
32 | } // namespace details |
33 | } // namespace spdlog |
34 | |
35 | #ifdef SPDLOG_HEADER_ONLY |
36 | # include "log_msg-inl.h" |
37 | #endif |
38 | |