summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2024-01-15 18:00:52 +0200
committerLars Wirzenius <liw@liw.fi>2024-01-15 18:00:52 +0200
commit3a56190257eb94ca7d95acf10cdac1f8f4d5435b (patch)
tree1197a82e36e61c3acb3e7283fe857d5bdd9e3220
parent7cab669ccaf5e4b7e4a686e0c8812a8b17de8ae3 (diff)
downloadradicle-native-ci-3a56190257eb94ca7d95acf10cdac1f8f4d5435b.tar.gz
refactor: rename LogFile to AdminLog
Signed-off-by: Lars Wirzenius <liw@liw.fi>
-rw-r--r--src/bin/radicle-native-ci.rs10
-rw-r--r--src/config.rs6
-rw-r--r--src/logfile.rs4
3 files changed, 10 insertions, 10 deletions
diff --git a/src/bin/radicle-native-ci.rs b/src/bin/radicle-native-ci.rs
index 67ba887..fcaa051 100644
--- a/src/bin/radicle-native-ci.rs
+++ b/src/bin/radicle-native-ci.rs
@@ -24,7 +24,7 @@ use radicle_ci_broker::msg::{Id, Oid, Request, RunId, RunResult};
use radicle_native_ci::{
config::{Config, ConfigError},
- logfile::{LogError, LogFile},
+ logfile::{AdminLog, LogError},
msg::{
read_request, write_errored, write_failed, write_succeeded, write_triggered,
NativeMessageError,
@@ -81,7 +81,7 @@ fn fallible_main() -> Result<(), NativeError> {
fn fallible_main_inner(
config: &Config,
- logfile: &mut LogFile,
+ logfile: &mut AdminLog,
builder: &mut RunInfoBuilder,
) -> Result<(), NativeError> {
let (run_id, run_dir) = mkdir_run(config)?;
@@ -154,7 +154,7 @@ struct Runner<'a> {
repo: Id,
commit: Oid,
src: PathBuf,
- log: &'a mut LogFile,
+ log: &'a mut AdminLog,
run_log: RunLog,
timeout: Option<usize>,
builder: &'a mut RunInfoBuilder,
@@ -252,7 +252,7 @@ struct RunnerBuilder<'a> {
repo: Option<Id>,
commit: Option<Oid>,
src: Option<PathBuf>,
- log: Option<&'a mut LogFile>,
+ log: Option<&'a mut AdminLog>,
run_log: Option<RunLog>,
timeout: Option<usize>,
builder: Option<&'a mut RunInfoBuilder>,
@@ -284,7 +284,7 @@ impl<'a> RunnerBuilder<'a> {
self
}
- fn log(mut self, log: &'a mut LogFile) -> Self {
+ fn log(mut self, log: &'a mut AdminLog) -> Self {
self.log = Some(log);
self
}
diff --git a/src/config.rs b/src/config.rs
index 621ce20..5da4db4 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -2,7 +2,7 @@ use std::path::{Path, PathBuf};
use serde::Deserialize;
-use crate::logfile::{LogError, LogFile};
+use crate::logfile::{AdminLog, LogError};
const DEFAULT_TIMEOUT: usize = 3600;
@@ -30,8 +30,8 @@ impl Config {
Ok(config)
}
- pub fn open_log(&self) -> Result<LogFile, ConfigError> {
- Ok(LogFile::open(&self.log)?)
+ pub fn open_log(&self) -> Result<AdminLog, ConfigError> {
+ Ok(AdminLog::open(&self.log)?)
}
/// Read configuration specification from a file.
diff --git a/src/logfile.rs b/src/logfile.rs
index 3391e20..c147e8a 100644
--- a/src/logfile.rs
+++ b/src/logfile.rs
@@ -5,12 +5,12 @@ use std::{
};
#[derive(Debug)]
-pub struct LogFile {
+pub struct AdminLog {
filename: PathBuf,
file: File,
}
-impl LogFile {
+impl AdminLog {
pub fn open(filename: &Path) -> Result<Self, LogError> {
let file = OpenOptions::new()
.append(true)