诸暨麻将添加redis
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.
 
 
 
 
 
 

58 lines
1.3 KiB

  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/common.h>
  6. #endif
  7. namespace spdlog {
  8. namespace level {
  9. static string_view_t level_string_views[] SPDLOG_LEVEL_NAMES;
  10. static const char *short_level_names[] SPDLOG_SHORT_LEVEL_NAMES;
  11. SPDLOG_INLINE string_view_t &to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT
  12. {
  13. return level_string_views[l];
  14. }
  15. SPDLOG_INLINE const char *to_short_c_str(spdlog::level::level_enum l) SPDLOG_NOEXCEPT
  16. {
  17. return short_level_names[l];
  18. }
  19. SPDLOG_INLINE spdlog::level::level_enum from_str(const std::string &name) SPDLOG_NOEXCEPT
  20. {
  21. int level = 0;
  22. for (const auto &level_str : level_string_views)
  23. {
  24. if (level_str == name)
  25. {
  26. return static_cast<level::level_enum>(level);
  27. }
  28. level++;
  29. }
  30. return level::off;
  31. }
  32. } // namespace level
  33. SPDLOG_INLINE spdlog_ex::spdlog_ex(std::string msg)
  34. : msg_(std::move(msg))
  35. {}
  36. SPDLOG_INLINE spdlog_ex::spdlog_ex(const std::string &msg, int last_errno)
  37. {
  38. memory_buf_t outbuf;
  39. fmt::format_system_error(outbuf, last_errno, msg);
  40. msg_ = fmt::to_string(outbuf);
  41. }
  42. SPDLOG_INLINE const char *spdlog_ex::what() const SPDLOG_NOEXCEPT
  43. {
  44. return msg_.c_str();
  45. }
  46. } // namespace spdlog