Skip to content

Commit 484323f

Browse files
committed
feat: implemented TraceEventsFileFormat::Binary in Tracer::store_trace_events
1 parent 8883f8a commit 484323f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

runtime_tracing/src/tracer.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::collections::HashMap;
44
use std::env;
55
use std::error::Error;
66
use std::fs;
7+
use std::io::stdout;
78
use std::path::{Path, PathBuf};
89

910
use crate::types::{
@@ -305,7 +306,10 @@ impl Tracer {
305306
let json = serde_json::to_string(&self.events)?;
306307
fs::write(path, json)?;
307308
}
308-
TraceEventsFileFormat::Binary => todo!(),
309+
TraceEventsFileFormat::Binary => {
310+
let file = fs::File::create(path)?;
311+
crate::capnptrace::write_trace(&self.events, file)?;
312+
}
309313
}
310314
Ok(())
311315
}

0 commit comments

Comments
 (0)