log_msg.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
  2. // Distributed under the MIT License (http://opensource.org/licenses/MIT)
  3. #pragma once
  4. #include <spdlog/common.h>
  5. #include <string>
  6. namespace spdlog {
  7. namespace details {
  8. struct SPDLOG_API log_msg
  9. {
  10. log_msg() = default;
  11. log_msg(log_clock::time_point log_time, source_loc loc, string_view_t logger_name, level::level_enum lvl, string_view_t msg);
  12. log_msg(source_loc loc, string_view_t logger_name, level::level_enum lvl, string_view_t msg);
  13. log_msg(string_view_t logger_name, level::level_enum lvl, string_view_t msg);
  14. log_msg(const log_msg &other) = default;
  15. log_msg &operator=(const log_msg &other) = default;
  16. string_view_t logger_name;
  17. level::level_enum level{level::off};
  18. log_clock::time_point time;
  19. size_t thread_id{0};
  20. // wrapping the formatted text with color (updated by pattern_formatter).
  21. mutable size_t color_range_start{0};
  22. mutable size_t color_range_end{0};
  23. source_loc source;
  24. string_view_t payload;
  25. };
  26. } // namespace details
  27. } // namespace spdlog
  28. #ifdef SPDLOG_HEADER_ONLY
  29. # include "log_msg-inl.h"
  30. #endif