Skip to content

Commit 545ed71

Browse files
Deprecate LogSink initialize signature
1 parent fe5ab0e commit 545ed71

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

include/livekit/livekit.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
namespace livekit {
4444

4545
/// The log sink to use for SDK messages.
46-
enum class LogSink {
46+
/// @deprecated Use livekit::setLogCallback instead to register a custom log callback
47+
enum class [[deprecated("Use livekit::setLogCallback instead to register a custom log callback")]] LogSink {
4748
/// Log messages to the console.
4849
kConsole = 0,
4950
/// Log messages to a callback function.
@@ -60,7 +61,18 @@ enum class LogSink {
6061
/// @param log_sink The log sink to use for SDK messages (default: Console).
6162
/// @returns true if initialization happened on this call, false if it was
6263
/// already initialized.
63-
LIVEKIT_API bool initialize(const LogLevel& level = LogLevel::Info, const LogSink& log_sink = LogSink::kConsole);
64+
/// @deprecated Use livekit::setLogCallback instead to register a custom log callback
65+
[[deprecated("Use livekit::setLogCallback instead to register a custom log callback")]] LIVEKIT_API bool initialize(
66+
const LogLevel& level, const LogSink& log_sink);
67+
68+
/// Initialize the LiveKit SDK.
69+
///
70+
/// This **must be the first LiveKit API called** in the process.
71+
/// It configures global SDK state.
72+
///
73+
/// @param level Minimum log level for SDK messages (default: Info).
74+
/// Use setLogLevel() to change at runtime.
75+
LIVEKIT_API bool initialize(const LogLevel& level = LogLevel::Info);
6476

6577
/// Shut down the LiveKit SDK.
6678
///

src/livekit.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
namespace livekit {
2323

2424
bool initialize(const LogLevel& level, const LogSink& log_sink) {
25+
(void)log_sink;
26+
return initialize(level);
27+
}
28+
29+
bool initialize(const LogLevel& level) {
2530
// Initializes logger if singleton instance is not already initialized
2631
setLogLevel(level);
2732
auto& ffi_client = FfiClient::instance();

0 commit comments

Comments
 (0)