Skip to content

Commit

Permalink
Add more logging for channels
Browse files Browse the repository at this point in the history
  • Loading branch information
Shatur committed Aug 9, 2024
1 parent 094406b commit 03bcee9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
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

0 comments on commit 03bcee9

Please sign in to comment.