|
Last change
on this file was
19170,
checked in by westram, 3 years ago
|
- sina source
- unpack + remove tarball
- no longer ignore sina builddir.
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 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 | #include <string> |
|---|
| 12 | #include <utility> |
|---|
| 13 | |
|---|
| 14 | namespace spdlog { |
|---|
| 15 | namespace details { |
|---|
| 16 | struct log_msg |
|---|
| 17 | { |
|---|
| 18 | |
|---|
| 19 | log_msg(source_loc loc, const std::string *loggers_name, level::level_enum lvl, string_view_t view) |
|---|
| 20 | : logger_name(loggers_name) |
|---|
| 21 | , level(lvl) |
|---|
| 22 | #ifndef SPDLOG_NO_DATETIME |
|---|
| 23 | , time(os::now()) |
|---|
| 24 | #endif |
|---|
| 25 | |
|---|
| 26 | #ifndef SPDLOG_NO_THREAD_ID |
|---|
| 27 | , thread_id(os::thread_id()) |
|---|
| 28 | #endif |
|---|
| 29 | , source(loc) |
|---|
| 30 | , payload(view) |
|---|
| 31 | { |
|---|
| 32 | } |
|---|
| 33 | |
|---|
| 34 | log_msg(const std::string *loggers_name, level::level_enum lvl, string_view_t view) |
|---|
| 35 | : log_msg(source_loc{}, loggers_name, lvl, view) |
|---|
| 36 | { |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | log_msg(const log_msg &other) = default; |
|---|
| 40 | |
|---|
| 41 | const std::string *logger_name{nullptr}; |
|---|
| 42 | level::level_enum level{level::off}; |
|---|
| 43 | log_clock::time_point time; |
|---|
| 44 | size_t thread_id{0}; |
|---|
| 45 | size_t msg_id{0}; |
|---|
| 46 | |
|---|
| 47 | // wrapping the formatted text with color (updated by pattern_formatter). |
|---|
| 48 | mutable size_t color_range_start{0}; |
|---|
| 49 | mutable size_t color_range_end{0}; |
|---|
| 50 | |
|---|
| 51 | source_loc source; |
|---|
| 52 | const string_view_t payload; |
|---|
| 53 | }; |
|---|
| 54 | } // namespace details |
|---|
| 55 | } // namespace spdlog |
|---|
Note: See
TracBrowser
for help on using the repository browser.