Skip to content

Commit

Permalink
Remove spdlog/fmt from header
Browse files Browse the repository at this point in the history
  • Loading branch information
mewim committed Apr 6, 2023
1 parent a2f042f commit 94cf544
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/common/utils.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "common/utils.h"

#include "spdlog/fmt/fmt.h"
#include "spdlog/sinks/stdout_sinks.h"
#include "spdlog/spdlog.h"

Expand Down Expand Up @@ -60,6 +61,11 @@ std::string LoggerUtils::getLoggerName(LoggerConstants::LoggerEnum loggerEnum) {
}
}

template<typename... Args>
std::string StringUtils::string_format(const std::string& format, Args... args) {
return fmt::format(fmt::runtime(format), args...);
}

std::vector<std::string> StringUtils::split(
const std::string& input, const std::string& delimiter) {
auto result = std::vector<std::string>();
Expand Down
5 changes: 1 addition & 4 deletions src/include/common/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include "common/constants.h"
#include "exception.h"
#include "spdlog/fmt/fmt.h"

namespace spdlog {
class logger;
Expand All @@ -35,9 +34,7 @@ class StringUtils {

public:
template<typename... Args>
inline static std::string string_format(const std::string& format, Args... args) {
return fmt::format(fmt::runtime(format), args...);
}
static std::string string_format(const std::string& format, Args... args);

static std::vector<std::string> split(const std::string& input, const std::string& delimiter);

Expand Down

0 comments on commit 94cf544

Please sign in to comment.