git » sdk » commit b2ee6d9

Environment variable to turn on WebRTC logs

author Stephen Paul Weber
2024-04-16 00:41:33 UTC
committer Stephen Paul Weber
2024-04-16 00:41:33 UTC
parent 4e05d5e123a76e5f45a295376b1c13dd64c632ef

Environment variable to turn on WebRTC logs

snikket/jingle/PeerConnection.cpp.hx +3 -1

diff --git a/snikket/jingle/PeerConnection.cpp.hx b/snikket/jingle/PeerConnection.cpp.hx
index 311be4f..d2ba4ed 100644
--- a/snikket/jingle/PeerConnection.cpp.hx
+++ b/snikket/jingle/PeerConnection.cpp.hx
@@ -396,7 +396,9 @@ class PeerConnection {
 	final mainLoop: sys.thread.EventLoop;
 
 	public function new(?configuration : Configuration, ?constraints : Dynamic){
-		//untyped __cpp__("rtc::InitLogger(rtc::LogLevel::Verbose);");
+		if (Sys.getEnv("SNIKKET_WEBRTC_DEBUG") != null) {
+			untyped __cpp__("rtc::InitLogger(rtc::LogLevel::Verbose);");
+		}
 		mainLoop = sys.thread.Thread.current().events;
 		_pc = PC.makeShared();
 		pc = cpp.Pointer.fromRaw(untyped __cpp__("{0}.get()", _pc));