Skip to content

Integrate spdlog #2551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
293668b
Add dependency on spdlog, set flags so library is built and headers a…
aymanhab Aug 20, 2019
f39f438
Merge branch 'master' into integrate_spdlog
aymanhab Aug 27, 2019
32b4ab2
Add spdlog to include paths
aymanhab Aug 27, 2019
4e95cb1
Add usage and fix CMakeFile to use headers from dependencies and to i…
aymanhab Aug 29, 2019
fd7b3e5
Convert tabs into spaces
aymanhab Aug 29, 2019
43e850b
Remove unnecessary dashes.
chrisdembia Oct 4, 2019
5f92a82
Fix spdlog CMake.
chrisdembia Oct 4, 2019
a4cb882
Merge branch 'master' of github.com:opensim-org/opensim-core into int…
chrisdembia Oct 4, 2019
e0b991b
Install spdlog.
chrisdembia Oct 4, 2019
0332552
Start employing spdlog in Model.cpp.
chrisdembia Oct 4, 2019
1908197
Set format of logger.
chrisdembia Oct 4, 2019
352e6ab
spdlog fPIC.
chrisdembia Oct 5, 2019
b460e16
Update README for spdlog.
chrisdembia Oct 5, 2019
c734325
Semicolons.
chrisdembia Oct 5, 2019
bbf162f
Fix spdlog OpenSimConfig.cmake.
chrisdembia Oct 5, 2019
3b4edcd
Merge branches 'integrate_spdlog' and 'master' of github.com:opensim-…
chrisdembia Oct 10, 2019
6b5262c
Reimplement setDebugLevel().
chrisdembia Oct 8, 2019
a02f794
LogManager::setLogLevel().
chrisdembia Oct 10, 2019
1d33fad
Reduce use of _debugLevel.
chrisdembia Oct 10, 2019
b144c36
Use getLogLevel().
chrisdembia Oct 10, 2019
b2d1020
Revert "Start employing spdlog in Model.cpp."
chrisdembia Oct 10, 2019
7ebe557
Create Log.h, Log.cpp.
chrisdembia Oct 10, 2019
0e894c6
Created LogSink.
chrisdembia Oct 10, 2019
a08cc1a
Test LogSink in Java.
chrisdembia Oct 10, 2019
c263c7f
Use Log::shouldLog().
chrisdembia Oct 10, 2019
3bed4cd
Bring spdlog into OpenSim.
chrisdembia Oct 11, 2019
4623793
Provide a way to get OpenSim messages on Windows in Matlab.
chrisdembia Oct 11, 2019
b9a9017
Add --log-level command line option.
chrisdembia Oct 11, 2019
548b428
Improve comment.
chrisdembia Oct 11, 2019
3242769
Merge pull request #2591 from opensim-org/spdlog_cmake
chrisdembia Oct 15, 2019
668690f
Merge branches 'feature_logging' and 'integrate_spdlog' of github.com…
chrisdembia Oct 15, 2019
992a8b2
Add Log.h, LogSink.h.
chrisdembia Oct 15, 2019
3d7cfd7
Use -d instead of -v. Log changes of log level.
chrisdembia Oct 15, 2019
0956c77
Allow using std::shared_ptr.
chrisdembia Oct 16, 2019
c6d7346
Rename Log to Logger.
chrisdembia Oct 16, 2019
c0215b3
Include template definitions. Free logging functions.
chrisdembia Oct 17, 2019
8fca31a
Merge branch 'spdlog_Log_class' into integrate_spdlog
chrisdembia Oct 17, 2019
980b619
Remove Log.h, Log.cpp.
chrisdembia Oct 17, 2019
d3a8267
Prefix with log_.
chrisdembia Oct 17, 2019
306cb56
Merge branch 'spdlog_Log_class' into integrate_spdlog
chrisdembia Oct 17, 2019
caed514
Get rid of some shouldLogs().
chrisdembia Oct 17, 2019
1b460bf
Remove shouldLogs.
chrisdembia Oct 17, 2019
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
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ else()
set(OPENSIM_INSTALL_JAVASRCDIR sdk/Java)
set(OPENSIM_INSTALL_APIEXDIR Resources/Code)
set(OPENSIM_INSTALL_SIMBODYDIR sdk/Simbody)
set(OPENSIM_INSTALL_SPDLOGDIR sdk/spdlog)

endif()

Expand Down Expand Up @@ -584,6 +585,15 @@ if(WITH_BTK)
endif()
endif()

#find_package(spdlog REQUIRED)
# if(NOT SPDLOG_FOUND)
# message("spdlog not found. Install spdlog and set
# SPDLOG_HOME to the installation directory of spdlog.")
#endif()
include_directories("${OPENSIM_DEPENDENCIES_DIR}/spdlog/include")



if(NOT SIMBODY_HOME AND OPENSIM_DEPENDENCIES_DIR)
set(SIMBODY_HOME "${OPENSIM_DEPENDENCIES_DIR}/simbody")
endif()
Expand Down Expand Up @@ -749,6 +759,13 @@ if(${OPENSIM_COPY_DEPENDENCIES})
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endif()

#SPDLOG
#---
set(SPDLOG_HOME "${OPENSIM_DEPENDENCIES_DIR}/spdlog")
if(WIN32)
install(DIRECTORY "${SPDLOG_HOME}/include"
DESTINATION "${OPENSIM_INSTALL_SPDLOGDIR}")
endif()
endif()

if(BUILD_PYTHON_WRAPPING AND OPENSIM_PYTHON_STANDALONE)
Expand Down
3 changes: 2 additions & 1 deletion OpenSim/Common/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "Property_Deprecated.h"
#include "PropertyTransform.h"
#include "IO.h"

#include "spdlog/spdlog.h"
#include <fstream>

using namespace OpenSim;
Expand Down Expand Up @@ -517,6 +517,7 @@ registerType(const Object& aObject)
}
if (_debugLevel>=2) {
cout << "Object.registerType: " << type << " .\n";
spdlog::debug("Object.registerType: {}!", type);
}

// REPLACE IF A MATCHING TYPE IS ALREADY REGISTERED
Expand Down
7 changes: 7 additions & 0 deletions dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ AddDependency(NAME simbody
AddDependency(NAME docopt
URL https://github.com/docopt/docopt.cpp.git
TAG af03fa044ee1eff20819549b534ea86829a24a54)


AddDependency(NAME spdlog
URL https://github.com/gabime/spdlog.git
TAG v1.3.1
CMAKE_ARGS -DSPDLOG_BUILD_BENCH:BOOL=OFF
-DSPDLOG_BUILD_EXAMPLE:BOOL=OFF)

#######################

Expand Down