Skip to content

Commit

Permalink
handle the filesystem::path args in logger
Browse files Browse the repository at this point in the history
  • Loading branch information
K1ngst0m committed Oct 28, 2023
1 parent 0b5a68b commit a8c2886
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions engine/common/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace aph
class Logger
{
public:
enum class Level: uint8_t
enum class Level : uint8_t
{
Debug,
Info,
Expand Down Expand Up @@ -60,15 +60,15 @@ class Logger
Logger();

// conversion for most types
template<typename T>
T to_format(const T& val) {
template <typename T>
T to_format(const T& val)
{
return val;
}

// specialization for std::string
const char* to_format(const std::string& val) {
return val.c_str();
}
const char* to_format(const char* val) { return val; }
const char* to_format(const std::string& val) { return val.c_str(); }
const char* to_format(const std::filesystem::path& val) { return val.c_str(); }

template <typename... Args>
void log(const char* level, std::string_view fmt, Args&&... args)
Expand Down

0 comments on commit a8c2886

Please sign in to comment.