diff --git a/interfaces/core/Log.h b/interfaces/core/Log.h index d7df993f..315d1ffe 100644 --- a/interfaces/core/Log.h +++ b/interfaces/core/Log.h @@ -4,15 +4,18 @@ #include #include -#include "spdlog.h" -#include "sinks/dist_sink.h" -#include "sinks/file_sinks.h" -#include "sinks/ostream_sink.h" +#include "spdlog/spdlog.h" +#include "spdlog/sinks/dist_sink.h" +#include "spdlog/sinks/basic_file_sink.h" +#include "spdlog/sinks/ostream_sink.h" +#include #include "SolARFrameworkDefinitions.h" #include -#include +#include #include +#include + namespace SolAR { /** @@ -84,6 +87,11 @@ namespace SolAR { Log::add_sink_console();\ } +#define LOG_ADD_LOG_TO_OTEL() \ +{ \ + Log::add_sink_otel();\ +} + /*! @} */ /*! \addtogroup Log_styles @@ -242,7 +250,7 @@ class Log{ else LOG_INFO( "{} is open ", fileName.c_str() ); - sink()->add_sink( std::make_shared< spdlog::sinks::simple_file_sink_st >( fileName.c_str() ) ); + sink()->add_sink( std::make_shared< spdlog::sinks::basic_file_sink_st >( fileName.c_str() ) ); } else{ LOG_WARNING( "{} is not a directory\n", pathname.c_str() ); @@ -252,6 +260,8 @@ class Log{ } static SOLARFRAMEWORK_API void add_sink_console(); + + static SOLARFRAMEWORK_API void add_sink_otel(); }; } diff --git a/interfaces/datastructure/GeometryDefinitions.h b/interfaces/datastructure/GeometryDefinitions.h index b0d278f2..84c3e888 100644 --- a/interfaces/datastructure/GeometryDefinitions.h +++ b/interfaces/datastructure/GeometryDefinitions.h @@ -25,6 +25,9 @@ #include #include +#include + + namespace SolAR { namespace datastructure { @@ -87,6 +90,7 @@ class Point3Df : public Vector { DECLARESERIALIZE(Point3Df); IMPLEMENTSERIALIZE(Point3Df); + /** * @class Point2Di * @brief A 2D point with coordinates defined with integers. @@ -307,4 +311,6 @@ inline void serialize(Archive & ar, }} // namespace boost::serialization +template <> struct fmt::formatter : ostream_formatter {}; + #endif // SOLAR_GEOMETRYDEFINITIONS_H diff --git a/interfaces/datastructure/MathDefinitions.h b/interfaces/datastructure/MathDefinitions.h index 4c3a1564..8e5c311e 100644 --- a/interfaces/datastructure/MathDefinitions.h +++ b/interfaces/datastructure/MathDefinitions.h @@ -28,6 +28,8 @@ #include #include +#include + #define SOLAR_PI 3.14159265358979323846 #define SOLAR_RAD2DEG 57.29577951308233 #define SOLAR_DEG2RAD 0.0174532925199433 @@ -462,4 +464,7 @@ inline void serialize(Archive & ar, } }} // namespace boost::serialization +template <> struct fmt::formatter : ostream_formatter {}; + + #endif // SOLAR_MATHSDEFINITIONS_H diff --git a/packagedependencies-linux.txt b/packagedependencies-linux.txt index 4292ef57..06b0b936 100644 --- a/packagedependencies-linux.txt +++ b/packagedependencies-linux.txt @@ -1,2 +1,2 @@ openimageio|3.1.7.0|OpenImageIO|conan|conan-center|static|with_ffmpeg=False#with_freetype=False#with_giflib=False#with_openvdb=False#with_libheif=False#with_libjxl=False#with_opencv=False#with_ptex=False#with_openjpeg=False#with_libwebp=False#with_libultrahdr=False#with_openjph=False -xpcf_static_deps|2.10.0|xpcf_static_deps|github|https://github.com/b-com-software-basis/xpcf/releases/download +xpcf_static_deps|2.11.1|xpcf_static_deps|github|https://github.com/b-com-software-basis/xpcf/releases/download diff --git a/packagedependencies.txt b/packagedependencies.txt index dac670a5..1370554c 100644 --- a/packagedependencies.txt +++ b/packagedependencies.txt @@ -1,4 +1,6 @@ eigen|3.4.0|eigen3|conan|conan-center|na|MPL2_only=True -spdlog|0.14.0|spdlog|thirdParties@github|https://github.com/SolarFramework/binaries/releases/download|shared| -nlohmann_json|3.9.1|nlohmann_json|conan|conan-center|na| +spdlog|1.14.1|spdlog|conan|conancenter|static| +nlohmann_json|3.11.3|nlohmann_json|conan|conan-center|na| boost#stable|1.84.0|boost|conan|conan-center|static| +opentelemetry_spdlog_sink|1.0.0|opentelemetry_spdlog_sink|thirdParties@github|https://github.com/SolarFramework/binaries/releases/download|static| +opentelemetry-cpp|1.22.0|opentelemetry-cpp-api|conan|conan-center|shared diff --git a/src/core/Log.cpp b/src/core/Log.cpp index ce75eb0e..b5b85aab 100644 --- a/src/core/Log.cpp +++ b/src/core/Log.cpp @@ -1,4 +1,7 @@ #include "core/Log.h" +#include +#include +#include using namespace SolAR; @@ -9,8 +12,14 @@ std::shared_ptr& Log::logger(){ SOLARFRAMEWORK_API void Log::add_sink_console() { #ifndef __ANDROID__ - sink()->add_sink(std::make_shared< spdlog::sinks::stdout_sink_mt >()); + sink()->add_sink(std::make_shared< spdlog::sinks::stdout_color_sink_mt>()); #else sink()->add_sink(std::make_shared< spdlog::sinks::android_sink >()); #endif - } +} + +SOLARFRAMEWORK_API void Log::add_sink_otel() { + auto otel_sink = std::make_shared(); + otel_sink->set_level(spdlog::level::debug); + sink()->add_sink(otel_sink); +}