mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
tracing-trace: introduce TraceWriter, trace now only exposes the channel
This commit is contained in:
parent
0f327f2821
commit
0e7a411d4d
3 changed files with 36 additions and 8 deletions
|
@ -9,11 +9,25 @@ pub mod processor;
|
|||
|
||||
pub use error::Error;
|
||||
|
||||
pub struct Trace<W: Write> {
|
||||
pub struct TraceWriter<W: Write> {
|
||||
writer: W,
|
||||
receiver: tokio::sync::mpsc::UnboundedReceiver<Entry>,
|
||||
}
|
||||
|
||||
pub struct Trace {
|
||||
receiver: tokio::sync::mpsc::UnboundedReceiver<Entry>,
|
||||
}
|
||||
|
||||
impl Trace {
|
||||
pub fn into_receiver(self) -> tokio::sync::mpsc::UnboundedReceiver<Entry> {
|
||||
self.receiver
|
||||
}
|
||||
|
||||
pub fn into_writer<W: Write>(self, writer: W) -> TraceWriter<W> {
|
||||
TraceWriter { writer, receiver: self.receiver }
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TraceReader<R: Read> {
|
||||
reader: R,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue