You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

log_msg.h 884B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // Copyright(c) 2015 Gabi Melman.
  3. // Distributed under the MIT License (http://opensource.org/licenses/MIT)
  4. //
  5. #pragma once
  6. #include <spdlog/common.h>
  7. #include <spdlog/details/os.h>
  8. #include <string>
  9. #include <utility>
  10. namespace spdlog
  11. {
  12. namespace details
  13. {
  14. struct log_msg
  15. {
  16. log_msg() = default;
  17. log_msg(const std::string *loggers_name, level::level_enum lvl) : logger_name(loggers_name), level(lvl)
  18. {
  19. #ifndef SPDLOG_NO_DATETIME
  20. time = os::now();
  21. #endif
  22. #ifndef SPDLOG_NO_THREAD_ID
  23. thread_id = os::thread_id();
  24. #endif
  25. }
  26. log_msg(const log_msg& other) = delete;
  27. log_msg& operator=(log_msg&& other) = delete;
  28. log_msg(log_msg&& other) = delete;
  29. const std::string *logger_name;
  30. level::level_enum level;
  31. log_clock::time_point time;
  32. size_t thread_id;
  33. fmt::MemoryWriter raw;
  34. fmt::MemoryWriter formatted;
  35. };
  36. }
  37. }