mirror of
https://github.com/LastExceed/spacermake.git
synced 2025-03-12 06:51:43 +01:00
disable csv headers
This commit is contained in:
parent
913697905f
commit
cdfd93674b
@ -4,6 +4,7 @@ use std::fs::File;
|
||||
|
||||
use chrono::Local;
|
||||
use colour::red_ln;
|
||||
use csv::WriterBuilder;
|
||||
use serde::Serialize;
|
||||
use tap::Pipe;
|
||||
|
||||
@ -31,10 +32,13 @@ pub fn machinelog(machine: &str, booking: &Booking) -> io::Result<()> {
|
||||
user: &booking.user
|
||||
};
|
||||
|
||||
File::options()
|
||||
let file_writer = File::options()
|
||||
.append(true)
|
||||
.open("/root/machinelog.csv")?
|
||||
.pipe(csv::Writer::from_writer)
|
||||
.open("/root/machinelog.csv")?;
|
||||
|
||||
WriterBuilder::new()
|
||||
.has_headers(false)
|
||||
.from_writer(file_writer)
|
||||
.serialize(&record)
|
||||
.map_err(|error| {
|
||||
red_ln!("error while serializing: {error}\n{record:#?}");
|
||||
|
Loading…
x
Reference in New Issue
Block a user