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.

35 lines
867B

  1. // Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
  2. // Distributed under the MIT License (http://opensource.org/licenses/MIT)
  3. #pragma once
  4. #ifndef SPDLOG_HEADER_ONLY
  5. #include "spdlog/details/log_msg.h"
  6. #endif
  7. #include "spdlog/details/os.h"
  8. namespace spdlog {
  9. namespace details {
  10. SPDLOG_INLINE log_msg::log_msg(spdlog::source_loc loc, string_view_t logger_name, spdlog::level::level_enum lvl, spdlog::string_view_t msg)
  11. : logger_name(logger_name)
  12. , level(lvl)
  13. #ifndef SPDLOG_NO_DATETIME
  14. , time(os::now())
  15. #endif
  16. #ifndef SPDLOG_NO_THREAD_ID
  17. , thread_id(os::thread_id())
  18. #endif
  19. , source(loc)
  20. , payload(msg)
  21. {}
  22. SPDLOG_INLINE log_msg::log_msg(string_view_t logger_name, spdlog::level::level_enum lvl, spdlog::string_view_t msg)
  23. : log_msg(source_loc{}, logger_name, lvl, msg)
  24. {}
  25. } // namespace details
  26. } // namespace spdlog