godotengine / webrtc-native

The official GDNative WebRTC implementation for non-html exports.
MIT License
198 stars 27 forks source link

Enable logging in godot as well #140

Closed Ughuuu closed 2 months ago

Ughuuu commented 3 months ago

Godot version

4.2

Plugin version

1.0.5

System information

macbook air m1

Issue description

I am trying to connect to another client, one is host one is client:

I also have a signaling server running locally, on localhost.

On the browser, everything works. Locally, multiplayer doesn't work. The two players aren't connected, and the callbacks aren't called for disconnected or anything.

While this might be an ok issue or not, the thing would be it would be nice to view this kind of logs in godot also, and maybe with a dropdown for what kind of logs to view.

Steps to reproduce

Exporting and running it with terminal I can see the logs for webrtc and I can see what's happening. For some reason, the ice transport doesn't seem to work while sending something:

2024-03-21 12:38:23.258 INFO  [953767] [rtc::impl::PeerConnection::changeState@1212] Changed state to connecting
2024-03-21 12:38:23.260 INFO  [955025] [rtc::impl::IceTransport::LogCallback@363] juice: Using STUN server stun.l.google.com:19302
2024-03-21 12:38:23.266 INFO  [955024] [rtc::impl::IceTransport::LogCallback@363] juice: STUN server binding successful
2024-03-21 12:38:23.266 INFO  [955024] [rtc::impl::IceTransport::LogCallback@363] juice: Got STUN mapped address 92.185.80.207:51794 from server
2024-03-21 12:38:23.267 INFO  [955024] [rtc::impl::IceTransport::LogCallback@363] juice: Candidate gathering done
2024-03-21 12:38:23.267 INFO  [955024] [rtc::impl::IceTransport::LogCallback@363] juice: Connectivity timer started
2024-03-21 12:38:23.267 INFO  [955024] [rtc::impl::PeerConnection::changeGatheringState@1248] Changed gathering state to complete
2024-03-21 12:38:23.361 WARN  [955024] [rtc::impl::IceTransport::LogCallback@363] juice: Send failed, errno=1
2024-03-21 12:38:23.361 WARN  [955024] [rtc::impl::IceTransport::LogCallback@363] juice: STUN message send failed
2024-03-21 12:38:38.273 INFO  [955024] [rtc::impl::IceTransport::LogCallback@363] juice: STUN server binding successful
2024-03-21 12:38:38.274 INFO  [955024] [rtc::impl::IceTransport::LogCallback@363] juice: Got STUN mapped address <ip>:51794 from server
2024-03-21 12:38:53.280 INFO  [955024] [rtc::impl::IceTransport::LogCallback@363] juice: STUN server binding successful
2024-03-21 12:38:53.280 INFO  [955024] [rtc::impl::IceTransport::LogCallback@363] juice: Got STUN mapped address <ip>:51794 from server
2024-03-21 12:39:02.917 INFO  [955024] [rtc::impl::IceTransport::LogCallback@363] juice: Connectivity timer expired
2024-03-21 12:39:02.917 INFO  [955024] [rtc::impl::IceTransport::LogCallback@363] juice: Changing state to failed
2024-03-21 12:39:02.917 INFO  [955024] [rtc::impl::PeerConnection::changeIceState@1230] Changed ICE state to failed
2024-03-21 12:39:02.917 INFO  [955024] [rtc::impl::PeerConnection::changeState@1212] Changed state to failed
2024-03-21 12:39:02.918 INFO  [955006] [rtc::impl::PeerConnection::changeIceState@1230] Changed ICE state to closed
2024-03-21 12:39:02.918 INFO  [955006] [rtc::impl::PeerConnection::changeState@1212] Changed state to closed
2024-03-21 12:39:02.918 DEBUG [955006] [rtc::impl::IceTransport::~IceTransport@160] Destroying ICE transport

Minimal reproduction project

No response

Faless commented 2 months ago

Fixed via #141