Skip to content

Commit 766ef4a

Browse files
tstennercboulay
authored andcommitted
Log version information on library initialization
1 parent 01044b5 commit 766ef4a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/common.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ void lsl::ensure_lsl_initialized() {
4747
loguru::init(argc, const_cast<char **>(argv));
4848
#else
4949
#endif
50+
LOG_F(INFO, "%s", lsl_library_info());
5051

5152
#ifdef _WIN32
5253
// if a timer resolution other than 0 is requested (0 means don't override)...

testing/catch_main.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
#define CATCH_CONFIG_RUNNER
22
#include "catch.hpp"
33

4+
extern "C" {
5+
const char *lsl_library_info() { return LSL_VERSION_INFO; }
6+
}
7+
48
int main(int argc, char *argv[]) {
59
Catch::Session session;
610
#ifdef _WIN32
711
session.configData().waitForKeypress = Catch::WaitForKeypress::BeforeExit;
812
#endif
913
session.configData().runOrder = Catch::RunTests::InRandomOrder;
10-
#ifdef LSL_VERSION_INFO
11-
std::cout << "liblsl version: " << LSL_VERSION_INFO << '\n';
12-
#endif
1314
int returnCode = session.applyCommandLine(argc, argv);
1415
if (returnCode != 0) return returnCode;
1516
return session.run();

0 commit comments

Comments
 (0)