Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions interfaces/core/Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
#include <sys/types.h>
#include <sys/stat.h>

#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 <spdlog/sinks/stdout_sinks.h>
#include "SolARFrameworkDefinitions.h"
#include <fstream>
#include <fmt/ostr.h>
#include <spdlog/fmt/ostr.h>
#include <vector>

#include <opentelemetry/instrumentation/spdlog/sink.h>

namespace SolAR {

/**
Expand Down Expand Up @@ -84,6 +87,11 @@ namespace SolAR {
Log::add_sink_console();\
}

#define LOG_ADD_LOG_TO_OTEL() \
{ \
Log::add_sink_otel();\
}

/*! @} */

/*! \addtogroup Log_styles
Expand Down Expand Up @@ -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() );
Expand All @@ -252,6 +260,8 @@ class Log{
}

static SOLARFRAMEWORK_API void add_sink_console();

static SOLARFRAMEWORK_API void add_sink_otel();
};

}
Expand Down
6 changes: 6 additions & 0 deletions interfaces/datastructure/GeometryDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#include <core/SolARFrameworkDefinitions.h>
#include <core/SerializationDefinitions.h>

#include <spdlog/fmt/ostr.h>


namespace SolAR {
namespace datastructure {

Expand Down Expand Up @@ -87,6 +90,7 @@ class Point3Df : public Vector<float,3> {
DECLARESERIALIZE(Point3Df);
IMPLEMENTSERIALIZE(Point3Df);


/**
* @class Point2Di
* @brief <B>A 2D point with coordinates defined with integers.</B>
Expand Down Expand Up @@ -307,4 +311,6 @@ inline void serialize(Archive & ar,

}} // namespace boost::serialization

template <> struct fmt::formatter<SolAR::datastructure::Point3Df> : ostream_formatter {};

#endif // SOLAR_GEOMETRYDEFINITIONS_H
5 changes: 5 additions & 0 deletions interfaces/datastructure/MathDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <Eigen/Eigen>
#include <math.h>

#include <spdlog/fmt/ostr.h>

#define SOLAR_PI 3.14159265358979323846
#define SOLAR_RAD2DEG 57.29577951308233
#define SOLAR_DEG2RAD 0.0174532925199433
Expand Down Expand Up @@ -462,4 +464,7 @@ inline void serialize(Archive & ar,
}
}} // namespace boost::serialization

template <> struct fmt::formatter<SolAR::datastructure::Transform3Df> : ostream_formatter {};


#endif // SOLAR_MATHSDEFINITIONS_H
2 changes: 1 addition & 1 deletion packagedependencies-linux.txt
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions packagedependencies.txt
Original file line number Diff line number Diff line change
@@ -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
13 changes: 11 additions & 2 deletions src/core/Log.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "core/Log.h"
#include <opentelemetry/instrumentation/spdlog/sink.h>
#include <spdlog/common.h>
#include <spdlog/sinks/stdout_color_sinks.h>

using namespace SolAR;

Expand All @@ -9,8 +12,14 @@ std::shared_ptr<spdlog::logger>& 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<spdlog::sinks::opentelemetry_sink_mt>();
otel_sink->set_level(spdlog::level::debug);
sink()->add_sink(otel_sink);
}