mirror of
https://github.com/LastExceed/spacermake.git
synced 2025-03-12 23:11:44 +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 chrono::Local;
|
||||||
use colour::red_ln;
|
use colour::red_ln;
|
||||||
|
use csv::WriterBuilder;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use tap::Pipe;
|
use tap::Pipe;
|
||||||
|
|
||||||
@ -31,10 +32,13 @@ pub fn machinelog(machine: &str, booking: &Booking) -> io::Result<()> {
|
|||||||
user: &booking.user
|
user: &booking.user
|
||||||
};
|
};
|
||||||
|
|
||||||
File::options()
|
let file_writer = File::options()
|
||||||
.append(true)
|
.append(true)
|
||||||
.open("/root/machinelog.csv")?
|
.open("/root/machinelog.csv")?;
|
||||||
.pipe(csv::Writer::from_writer)
|
|
||||||
|
WriterBuilder::new()
|
||||||
|
.has_headers(false)
|
||||||
|
.from_writer(file_writer)
|
||||||
.serialize(&record)
|
.serialize(&record)
|
||||||
.map_err(|error| {
|
.map_err(|error| {
|
||||||
red_ln!("error while serializing: {error}\n{record:#?}");
|
red_ln!("error while serializing: {error}\n{record:#?}");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user