common.cpp 523 B

1234567891011121314151617181920212223
  1. #include "smartbotic/common.hpp"
  2. #include <spdlog/spdlog.h>
  3. #include <format>
  4. namespace smartbotic::common {
  5. auto Version::GetString() -> std::string {
  6. return std::format("{}.{}.{}", kMajor, kMinor, kPatch);
  7. }
  8. void Initialize(std::string_view app_name) {
  9. spdlog::set_pattern("[%Y-%m-%d %H:%M:%S.%e] [%n] [%^%l%$] %v");
  10. spdlog::info("{} v{} initializing", app_name, Version::GetString());
  11. }
  12. void Shutdown() {
  13. spdlog::info("Shutting down");
  14. spdlog::shutdown();
  15. }
  16. } // namespace smartbotic::common