clang-format
This commit is contained in:
		@@ -62,12 +62,12 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    // Return reference to the front item.
 | 
					    // Return reference to the front item.
 | 
				
			||||||
    // If there are no elements in the container, the behavior is undefined.
 | 
					    // If there are no elements in the container, the behavior is undefined.
 | 
				
			||||||
    const T& front() const
 | 
					    const T &front() const
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        return v_[head_];
 | 
					        return v_[head_];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    T& front()
 | 
					    T &front()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        return v_[head_];
 | 
					        return v_[head_];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -87,7 +87,7 @@ public:
 | 
				
			|||||||
    bool full() const
 | 
					    bool full() const
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        // head is ahead of the tail by 1
 | 
					        // head is ahead of the tail by 1
 | 
				
			||||||
        if(max_items_ > 0)
 | 
					        if (max_items_ > 0)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return ((tail_ + 1) % max_items_) == head_;
 | 
					            return ((tail_ + 1) % max_items_) == head_;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,51 +10,51 @@
 | 
				
			|||||||
namespace spdlog {
 | 
					namespace spdlog {
 | 
				
			||||||
namespace details {
 | 
					namespace details {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg &orig_msg)
 | 
					SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg &orig_msg)
 | 
				
			||||||
    : log_msg{orig_msg}
 | 
					    : log_msg{orig_msg}
 | 
				
			||||||
    {
 | 
					{
 | 
				
			||||||
    buffer.append(logger_name.begin(), logger_name.end());
 | 
					    buffer.append(logger_name.begin(), logger_name.end());
 | 
				
			||||||
    buffer.append(payload.begin(), payload.end());
 | 
					    buffer.append(payload.begin(), payload.end());
 | 
				
			||||||
    update_string_views();
 | 
					    update_string_views();
 | 
				
			||||||
    }
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg_buffer &other)
 | 
					SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg_buffer &other)
 | 
				
			||||||
    : log_msg{other}
 | 
					    : log_msg{other}
 | 
				
			||||||
    {
 | 
					{
 | 
				
			||||||
    buffer.append(logger_name.begin(), logger_name.end());
 | 
					    buffer.append(logger_name.begin(), logger_name.end());
 | 
				
			||||||
    buffer.append(payload.begin(), payload.end());
 | 
					    buffer.append(payload.begin(), payload.end());
 | 
				
			||||||
    update_string_views();
 | 
					    update_string_views();
 | 
				
			||||||
    }
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   SPDLOG_INLINE log_msg_buffer:: log_msg_buffer(log_msg_buffer &&other)
 | 
					SPDLOG_INLINE log_msg_buffer::log_msg_buffer(log_msg_buffer &&other)
 | 
				
			||||||
    : log_msg{std::move(other)}
 | 
					    : log_msg{std::move(other)}
 | 
				
			||||||
    , buffer{std::move(other.buffer)}
 | 
					    , buffer{std::move(other.buffer)}
 | 
				
			||||||
    {
 | 
					{
 | 
				
			||||||
    update_string_views();
 | 
					    update_string_views();
 | 
				
			||||||
    }
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(const log_msg_buffer &other)
 | 
					SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(const log_msg_buffer &other)
 | 
				
			||||||
    {
 | 
					{
 | 
				
			||||||
    log_msg::operator=(other);
 | 
					    log_msg::operator=(other);
 | 
				
			||||||
    buffer.clear();
 | 
					    buffer.clear();
 | 
				
			||||||
    buffer.append(other.buffer.data(), other.buffer.data() + other.buffer.size());
 | 
					    buffer.append(other.buffer.data(), other.buffer.data() + other.buffer.size());
 | 
				
			||||||
    update_string_views();
 | 
					    update_string_views();
 | 
				
			||||||
    return *this;
 | 
					    return *this;
 | 
				
			||||||
    }
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(log_msg_buffer &&other)
 | 
					SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(log_msg_buffer &&other)
 | 
				
			||||||
    {
 | 
					{
 | 
				
			||||||
    log_msg::operator=(std::move(other));
 | 
					    log_msg::operator=(std::move(other));
 | 
				
			||||||
    buffer = std::move(other.buffer);
 | 
					    buffer = std::move(other.buffer);
 | 
				
			||||||
    update_string_views();
 | 
					    update_string_views();
 | 
				
			||||||
    return *this;
 | 
					    return *this;
 | 
				
			||||||
    }
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    SPDLOG_INLINE void log_msg_buffer::update_string_views()
 | 
					SPDLOG_INLINE void log_msg_buffer::update_string_views()
 | 
				
			||||||
    {
 | 
					{
 | 
				
			||||||
    logger_name = string_view_t{buffer.data(), logger_name.size()};
 | 
					    logger_name = string_view_t{buffer.data(), logger_name.size()};
 | 
				
			||||||
        payload = string_view_t{buffer.data()+logger_name.size(), payload.size()};
 | 
					    payload = string_view_t{buffer.data() + logger_name.size(), payload.size()};
 | 
				
			||||||
    }
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} // namespace details
 | 
					} // namespace details
 | 
				
			||||||
} // namespace spdlog
 | 
					} // namespace spdlog
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,6 +15,7 @@ class log_msg_buffer : public log_msg
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    memory_buf_t buffer;
 | 
					    memory_buf_t buffer;
 | 
				
			||||||
    void update_string_views();
 | 
					    void update_string_views();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
    log_msg_buffer() = default;
 | 
					    log_msg_buffer() = default;
 | 
				
			||||||
    explicit log_msg_buffer(const log_msg &orig_msg);
 | 
					    explicit log_msg_buffer(const log_msg &orig_msg);
 | 
				
			||||||
@@ -22,7 +23,6 @@ public:
 | 
				
			|||||||
    log_msg_buffer(log_msg_buffer &&other);
 | 
					    log_msg_buffer(log_msg_buffer &&other);
 | 
				
			||||||
    log_msg_buffer &operator=(const log_msg_buffer &other);
 | 
					    log_msg_buffer &operator=(const log_msg_buffer &other);
 | 
				
			||||||
    log_msg_buffer &operator=(log_msg_buffer &&other);
 | 
					    log_msg_buffer &operator=(log_msg_buffer &&other);
 | 
				
			||||||
   
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} // namespace details
 | 
					} // namespace details
 | 
				
			||||||
@@ -31,4 +31,3 @@ public:
 | 
				
			|||||||
#ifdef SPDLOG_HEADER_ONLY
 | 
					#ifdef SPDLOG_HEADER_ONLY
 | 
				
			||||||
#include "log_msg_buffer-inl.h"
 | 
					#include "log_msg_buffer-inl.h"
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -85,7 +85,6 @@ public:
 | 
				
			|||||||
        std::unique_lock<std::mutex> lock(queue_mutex_);
 | 
					        std::unique_lock<std::mutex> lock(queue_mutex_);
 | 
				
			||||||
        q_.push_back(std::move(item));
 | 
					        q_.push_back(std::move(item));
 | 
				
			||||||
        push_cv_.notify_one();
 | 
					        push_cv_.notify_one();
 | 
				
			||||||
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // try to dequeue item. if no item found. wait upto timeout and try again
 | 
					    // try to dequeue item. if no item found. wait upto timeout and try again
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -396,8 +396,8 @@ SPDLOG_INLINE bool is_color_terminal() SPDLOG_NOEXCEPT
 | 
				
			|||||||
#ifdef _WIN32
 | 
					#ifdef _WIN32
 | 
				
			||||||
    return true;
 | 
					    return true;
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    static constexpr std::array<const char *, 14> Terms = {{
 | 
					    static constexpr std::array<const char *, 14> Terms = {
 | 
				
			||||||
        "ansi", "color", "console", "cygwin", "gnome", "konsole", "kterm", "linux", "msys", "putty", "rxvt", "screen", "vt100", "xterm"}};
 | 
					        {"ansi", "color", "console", "cygwin", "gnome", "konsole", "kterm", "linux", "msys", "putty", "rxvt", "screen", "vt100", "xterm"}};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const char *env_p = std::getenv("TERM");
 | 
					    const char *env_p = std::getenv("TERM");
 | 
				
			||||||
    if (env_p == nullptr)
 | 
					    if (env_p == nullptr)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -209,8 +209,8 @@ public:
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Full month name
 | 
					// Full month name
 | 
				
			||||||
static const std::array<const char *, 12> full_months{{
 | 
					static const std::array<const char *, 12> full_months{
 | 
				
			||||||
    "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}};
 | 
					    {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
template<typename ScopedPadder>
 | 
					template<typename ScopedPadder>
 | 
				
			||||||
class B_formatter : public flag_formatter
 | 
					class B_formatter : public flag_formatter
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,7 +13,6 @@
 | 
				
			|||||||
#include "spdlog/details/log_msg.h"
 | 
					#include "spdlog/details/log_msg.h"
 | 
				
			||||||
#include "spdlog/sinks/sink.h"
 | 
					#include "spdlog/sinks/sink.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace spdlog {
 | 
					namespace spdlog {
 | 
				
			||||||
namespace sinks {
 | 
					namespace sinks {
 | 
				
			||||||
template<typename Mutex>
 | 
					template<typename Mutex>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user