49 lines
1.1 KiB
C
Raw Normal View History

2016-04-20 11:57:49 +03:00
//
// Copyright(c) 2015 Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
//
#pragma once
2018-04-29 01:43:42 +03:00
#include "spdlog/common.h"
#include "spdlog/details/os.h"
2016-04-20 11:57:49 +03:00
#include <string>
#include <utility>
2018-03-17 12:47:46 +02:00
namespace spdlog {
namespace details {
2016-04-20 11:57:49 +03:00
struct log_msg
{
log_msg() = default;
2018-03-09 15:26:33 +02:00
log_msg(const std::string *loggers_name, level::level_enum lvl)
: logger_name(loggers_name)
, level(lvl)
2016-07-08 17:50:13 +03:00
#ifndef SPDLOG_NO_DATETIME
, time(os::now())
2016-07-08 17:50:13 +03:00
#endif
2016-04-20 11:57:49 +03:00
2016-07-08 17:50:13 +03:00
#ifndef SPDLOG_NO_THREAD_ID
, thread_id(os::thread_id())
2016-07-08 17:50:13 +03:00
#endif
{
2016-04-20 11:57:49 +03:00
}
2018-03-09 15:26:33 +02:00
log_msg(const log_msg &other) = delete;
log_msg(log_msg &&other) = delete;
2018-04-14 03:34:57 +03:00
log_msg &operator=(log_msg &&other) = delete;
2016-04-20 11:57:49 +03:00
2018-03-09 15:26:33 +02:00
const std::string *logger_name{nullptr};
2016-04-20 11:57:49 +03:00
level::level_enum level;
log_clock::time_point time;
size_t thread_id;
2018-06-12 18:48:22 +03:00
fmt::memory_buffer raw;
2018-10-01 14:27:43 +03:00
mutable size_t msg_id{0};
2018-04-14 03:34:57 +03:00
// info about wrapping the formatted text with color
2018-06-24 01:32:39 +03:00
mutable size_t color_range_start{0};
mutable size_t color_range_end{0};
2016-04-20 11:57:49 +03:00
};
2018-03-17 12:47:46 +02:00
} // namespace details
} // namespace spdlog