Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more logging for channels #320

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/core/channels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ impl RepliconChannels {
}

self.server.push(channel);
self.server.len() as u8 - 1
let id = self.server.len() as u8 - 1;
debug!("creating a server channel with ID {id}");

id
}

/// Creates a new client channel and returns its ID.
Expand All @@ -96,7 +99,10 @@ impl RepliconChannels {
}

self.client.push(channel);
self.client.len() as u8 - 1
let id = self.client.len() as u8 - 1;
debug!("creating a client channel with ID {id}");

id
}

/// Returns a mutable reference to a server channel.
Expand Down
2 changes: 2 additions & 0 deletions src/core/event_registry/client_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ impl ClientEventAppExt for App {
serialize: SerializeFn<E>,
deserialize: DeserializeFn<E>,
) -> &mut Self {
debug!("registering client event `{}`", any::type_name::<E>());

self.add_event::<E>()
.add_event::<FromClient<E>>()
.init_resource::<ClientEventReader<E>>();
Expand Down
2 changes: 2 additions & 0 deletions src/core/event_registry/server_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ impl ServerEventAppExt for App {
serialize: SerializeFn<E>,
deserialize: DeserializeFn<E>,
) -> &mut Self {
debug!("registering server event `{}`", any::type_name::<E>());

self.add_event::<E>()
.add_event::<ToClients<E>>()
.init_resource::<ServerEventQueue<E>>();
Expand Down