Agora  1.2.0
Agora project
log_msg_buffer-inl.h
Go to the documentation of this file.
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 #ifndef SPDLOG_HEADER_ONLY
8 #endif
9 
10 namespace spdlog {
11 namespace details {
12 
14  : log_msg{orig_msg}
15 {
16  buffer.append(logger_name.begin(), logger_name.end());
17  buffer.append(payload.begin(), payload.end());
18  update_string_views();
19 }
20 
22  : log_msg{other}
23 {
24  buffer.append(logger_name.begin(), logger_name.end());
25  buffer.append(payload.begin(), payload.end());
26  update_string_views();
27 }
28 
29 SPDLOG_INLINE log_msg_buffer::log_msg_buffer(log_msg_buffer &&other) SPDLOG_NOEXCEPT : log_msg{other}, buffer{std::move(other.buffer)}
30 {
31  update_string_views();
32 }
33 
35 {
36  log_msg::operator=(other);
37  buffer.clear();
38  buffer.append(other.buffer.data(), other.buffer.data() + other.buffer.size());
40  return *this;
41 }
42 
44 {
45  log_msg::operator=(other);
46  buffer = std::move(other.buffer);
47  update_string_views();
48  return *this;
49 }
50 
52 {
55 }
56 
57 } // namespace details
58 } // namespace spdlog
SPDLOG_NOEXCEPT
#define SPDLOG_NOEXCEPT
Definition: common.h:64
spdlog::details::log_msg_buffer::log_msg_buffer
log_msg_buffer()=default
spdlog::details::log_msg::payload
string_view_t payload
Definition: log_msg.h:30
fmt::v8::detail::buffer::size
constexpr auto size() const -> size_t
Definition: core.h:820
fmt::v8::basic_string_view
Definition: core.h:448
fmt::v8::detail::buffer::clear
void clear()
Definition: core.h:832
fmt::v8::basic_string_view::size
constexpr auto size() const -> size_t
Definition: core.h:495
spdlog
Definition: async.h:25
spdlog::details::log_msg::logger_name
string_view_t logger_name
Definition: log_msg.h:20
SPDLOG_INLINE
#define SPDLOG_INLINE
Definition: common.h:42
spdlog::details::log_msg_buffer
Definition: log_msg_buffer.h:14
spdlog::details::log_msg_buffer::operator=
log_msg_buffer & operator=(const log_msg_buffer &other)
Definition: log_msg_buffer-inl.h:34
fmt::v8::basic_memory_buffer::append
void append(const ContiguousRange &range)
Definition: format.h:771
fmt::v8::detail::buffer::data
auto data() -> T *
Definition: core.h:826
spdlog::details::log_msg_buffer::buffer
memory_buf_t buffer
Definition: log_msg_buffer.h:16
spdlog::details::log_msg
Definition: log_msg.h:11
log_msg_buffer.h
spdlog::details::log_msg::operator=
log_msg & operator=(const log_msg &other)=default
spdlog::details::log_msg_buffer::update_string_views
void update_string_views()
Definition: log_msg_buffer-inl.h:51