diff --git a/src/device/DataQueue.cpp b/src/device/DataQueue.cpp index e16f2c8a1..5936b843e 100644 --- a/src/device/DataQueue.cpp +++ b/src/device/DataQueue.cpp @@ -18,6 +18,7 @@ // libraries #include "utility/Logging.hpp" +#include "utility/spdlog-fmt.hpp" // Additions #include "spdlog/fmt/bin_to_hex.h" diff --git a/src/device/DeviceBase.cpp b/src/device/DeviceBase.cpp index 151e8f60b..3f81121ed 100644 --- a/src/device/DeviceBase.cpp +++ b/src/device/DeviceBase.cpp @@ -27,6 +27,7 @@ #include "utility/Initialization.hpp" #include "utility/PimplImpl.hpp" #include "utility/Resources.hpp" +#include "utility/spdlog-fmt.hpp" // libraries #include "XLink/XLink.h" diff --git a/src/pipeline/datatype/StreamMessageParser.cpp b/src/pipeline/datatype/StreamMessageParser.cpp index 811cc62a0..f1cdcc706 100644 --- a/src/pipeline/datatype/StreamMessageParser.cpp +++ b/src/pipeline/datatype/StreamMessageParser.cpp @@ -9,6 +9,7 @@ #include #include "utility/Logging.hpp" +#include "utility/spdlog-fmt.hpp" // project #include "depthai/pipeline/datatype/ADatatype.hpp" diff --git a/src/utility/spdlog-fmt.hpp b/src/utility/spdlog-fmt.hpp index f1d5cf2c6..4277747e6 100755 --- a/src/utility/spdlog-fmt.hpp +++ b/src/utility/spdlog-fmt.hpp @@ -4,6 +4,13 @@ #include "depthai/utility/Path.hpp" +#if FMT_VERSION >= 100000 +#include + +#include "depthai/common/CameraBoardSocket.hpp" +#include "depthai-shared/datatype/DatatypeEnum.hpp" +#endif + namespace dai { namespace utility { static constexpr char path_convert_err[] = ""; @@ -25,3 +32,15 @@ struct fmt::formatter : formatter { return formatter::format(output, ctx); } }; + +#if FMT_VERSION >= 100000 +template <> +struct fmt::formatter : ostream_formatter {}; + +template <> +struct fmt::formatter : fmt::formatter { + auto format(dai::DatatypeEnum my, format_context& ctx) const -> decltype(ctx.out()) { + return fmt::format_to(ctx.out(), "{}", static_cast(my)); + } +}; +#endif