Add INFO logging for channel creation/garbage-collection

This commit is contained in:
Tangent Wantwight 2020-09-09 21:57:33 -04:00
parent 4dc8ec1bbd
commit c8124ed388
3 changed files with 9 additions and 0 deletions

View File

@ -1,5 +1,6 @@
## v0.3.1-dev ## v0.3.1-dev
- forget a channel's initialization segment when no transmitter is active. This improves behavior when a channel is occasionally used for streams with different codecs. - forget a channel's initialization segment when no transmitter is active. This improves behavior when a channel is occasionally used for streams with different codecs.
- Add INFO logging for channel creation/garbage-collection
## v0.3.0 ## v0.3.0
- update internals to v0.2 of `warp` and `tokio`; no remaining code relies on `futures` 0.1 - update internals to v0.2 of `warp` and `tokio`; no remaining code relies on `futures` 0.1

View File

@ -25,6 +25,7 @@ pub type Handle = Arc<Mutex<Channel>>;
impl Channel { impl Channel {
pub fn new(name: String) -> Handle { pub fn new(name: String) -> Handle {
info!("Opening Channel {}", name);
Arc::new(Mutex::new(Channel { Arc::new(Mutex::new(Channel {
name, name,
header_chunk: None, header_chunk: None,
@ -33,6 +34,12 @@ impl Channel {
} }
} }
impl Drop for Channel {
fn drop(&mut self) {
info!("Closing Channel {}", self.name);
}
}
pub struct Transmitter { pub struct Transmitter {
channel: Handle, channel: Handle,
} }

View File

@ -1,3 +1,4 @@
#[macro_use] extern crate log;
pub mod ebml; pub mod ebml;
pub mod error; pub mod error;