logging levels configurable at runtime (log.level in the api config)
optional logging to a file (log.file in the api config)
a compile time switch for debug messages (LSL_DEBUGLOG)
log messages include a name for the originating thread
optional printing of the stacktrace on abort (or segfault)
An example log output looks like this
date time ( uptime ) [ thread name/id ] file:line v|
2019-09-03 17:05:51.002 ( 7.693s) [main thread ] stream_outlet_impl.cpp:65 2| timesync: Trying to listen at address ''
2019-09-03 17:05:51.002 ( 7.693s) [main thread ] tcp_server.cpp:67 2| Created TCP server for outlet timesync on IPv6 port 16573
2019-09-03 17:05:51.002 ( 7.693s) [main thread ] udp_server.cpp:36 2| timesync: Started unicast udp server 0x559bf82d41b0 at port 16573
2019-09-03 17:05:51.002 ( 7.693s) [main thread ] udp_server.cpp:81 2| timesync: Started multicast udp server at FF02:113D:6FDD:2C17:A643:FFE2:1BD1:3CD2 port 16571
2019-09-03 17:05:51.002 ( 7.693s) [main thread ] udp_server.cpp:81 2| timesync: Started multicast udp server at FF05:113D:6FDD:2C17:A643:FFE2:1BD1:3CD2 port 16571
2019-09-03 17:05:51.504 ( 8.195s) [main thread ] inlet_connection.cpp:55 WARN| The stream named 'timesync' can't be recovered automatically if its provider crashes because it doesn't have a unique source ID
2019-09-03 16:54:00.744 ( 8.200s) [T_timesync ] time_receiver.cpp:94 2| Started time receiver thread
The only minor setback is the C++11 requirement (i.e., MSVC 2015), so it'd have to wait for 1.14.
This PR adds a logging library to liblsl.
Benefits:
log.level
in the api config)log.file
in the api config)LSL_DEBUGLOG
)An example log output looks like this
The only minor setback is the C++11 requirement (i.e., MSVC 2015), so it'd have to wait for 1.14.