Livox SDK API  V2.2.0
log_msg.h
Go to the documentation of this file.
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};
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 
53 };
54 } // namespace details
55 } // namespace spdlog
const std::string * logger_name
Definition: log_msg.h:41
spdlog::log_clock::time_point now() noexcept
Definition: os.h:60
Definition: async.h:27
level::level_enum level
Definition: log_msg.h:42
const string_view_t payload
Definition: log_msg.h:52
log_msg(source_loc loc, const std::string *loggers_name, level::level_enum lvl, string_view_t view)
Definition: log_msg.h:19
log_clock::time_point time
Definition: log_msg.h:43
log_msg(const std::string *loggers_name, level::level_enum lvl, string_view_t view)
Definition: log_msg.h:34