|
LiveKit C++ Client SDK v1.1.0
Real-time audio/video/data SDK for C++
|
The SDK uses spdlog internally but does not expose it in public headers. All log output goes through a thin public API in <livekit/logging.h>.
| Tier | When | How | Cost |
|---|---|---|---|
| Compile-time | CMake configure | -DLIVEKIT_LOG_LEVEL=WARN | Zero — calls below the level are stripped from the binary |
| Runtime | Any time after initialize() | livekit::setLogLevel(LogLevel::Warn) | Minimal — a level check before formatting |
Set once when you configure CMake. Calls below this threshold are completely removed by the preprocessor — no format-string evaluation, no function call.
Valid values: TRACE, DEBUG, INFO, WARN, ERROR, CRITICAL, OFF.
Among the levels that survived compilation you can still filter at runtime without rebuilding:
Replace the default stderr sink with your own handler. This is the integration point for frameworks like ROS2 (RCLCPP_* macros), Android logcat, or any structured-logging pipeline:
See the logging_levels/custom_sinks.cpp example for three copy-paste-ready patterns: a file logger, JSON structured lines, and a ROS2 bridge that maps LogLevel to RCLCPP_* macros.
| Level | Typical use |
|---|---|
Trace | Per-frame / per-packet detail (very noisy) |
Debug | Diagnostic info useful during development |
Info | Normal operational messages (connection, track events) |
Warn | Unexpected but recoverable situations |
Error | Failures that affect functionality |
Critical | Unrecoverable errors |
Off | Suppress all output |