feat: forward libwebrtc logs (#75)

This commit is contained in:
Théo Monnom
2023-05-24 18:37:35 +02:00
committed by GitHub
parent d5b4a8f6fc
commit 3f61e07e09
19 changed files with 300 additions and 98 deletions
+6 -3
View File
@@ -1,18 +1,21 @@
use livekit::prelude::*;
use std::env;
// Basic demo to connect to a room using the specified env variables
// Connect to a room using the specified env variables
// and print all incoming events
#[tokio::main]
async fn main() {
env_logger::init();
let url = env::var("LIVEKIT_URL").expect("LIVEKIT_URL is not set");
let token = env::var("LIVEKIT_TOKEN").expect("LIVEKIT_TOKEN is not set");
let (room, mut rx) = Room::connect(&url, &token).await.unwrap();
let session = room.session();
println!("Connected to room: {} - {}", session.name(), session.sid());
log::info!("Connected to room: {} - {}", session.name(), session.sid());
while let Some(msg) = rx.recv().await {
println!("Event: {:?}", msg);
log::info!("Event: {:?}", msg);
}
}