Skip to content

Commit 87fb8f4

Browse files
committed
added Util::Transform logging
1 parent 7c16742 commit 87fb8f4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

include/Util/Logger.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
#include <spdlog/spdlog.h>
77

8+
#include "Util/Transform.hpp"
9+
810
namespace Util::Logger {
911
enum class Level {
1012
TRACE,
@@ -28,4 +30,14 @@ Level GetLevel();
2830
#define LOG_CRITICAL(...) spdlog::critical(__VA_ARGS__)
2931
} // namespace Util::Logger
3032

33+
template <>
34+
struct fmt::formatter<Util::Transform> : fmt::formatter<std::string> {
35+
auto format(Util::Transform t, format_context &ctx) const
36+
-> decltype(ctx.out()) {
37+
return format_to(ctx.out(), "T: {} R: {} rad S: {}",
38+
glm::to_string(t.translation), t.rotation,
39+
glm::to_string(t.scale));
40+
}
41+
};
42+
3143
#endif

0 commit comments

Comments
 (0)