remove unused logger

This commit is contained in:
askiiart 2025-01-27 13:24:42 -06:00
parent e24eeebe24
commit 7b4f389b04
Signed by untrusted user who does not match committer: askiiart
GPG key ID: 6A32977DAF31746A

View file

@ -1,44 +1,8 @@
use crate::errors::Error;
use std::fs::{File, OpenOptions};
use std::io::Write;
/// The logger for gregory itself - NOT for jobs
pub(crate) struct Logger {
log_file: File,
}
impl Logger {
pub(crate) fn new(path: String) -> Result<Logger, Error> {
match OpenOptions::new().append(true).open(path) {
Ok(f) => return Ok(Logger { log_file: f }),
Err(e) => {
return Err(Error::IOError(e));
}
}
}
/// Log a warning
///
/// Fun gregory lore: I originally typo'd this as "Strign" and the linter didn't catch it for some reason
pub(crate) fn warning(&mut self, text: String) -> Result<(), Error> {
match writeln!(&mut self.log_file, "[WARNING] {}", text) {
Ok(_) => return Ok(()),
Err(e) => {
return Err(Error::IOError(e));
}
}
}
/// Log an error
pub(crate) fn error(&mut self, text: String) -> Result<(), Error> {
match writeln!(&mut self.log_file, "[ERROR] {}", text) {
Ok(_) => return Ok(()),
Err(e) => {
return Err(Error::IOError(e));
}
}
}
}
use std::path::Path;
use std::time::Instant;
/// Logging for a [`Job`]
pub(crate) struct JobLogger {