Skip to content

Commit c628125

Browse files
committed
refactor(store): adjust log levels for some messages
1 parent c91b9ef commit c628125

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/bins/daemon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ fn wakeup(store: &mut Store) -> Result<(), RunError> {
103103

104104
let mut buf = String::new();
105105
display_group(&store.make_checks(), &mut buf)?;
106-
info!("{buf}");
106+
info!("Made checks\n{buf}");
107107

108108
if let Err(err) = store.save() {
109109
error!("error while saving to file: {err:}");

src/store.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use std::str::FromStr;
2626

2727
use deepsize::DeepSizeOf;
2828
use serde::{Deserialize, Serialize};
29-
use tracing::{error, trace, warn};
29+
use tracing::{error, info, trace, warn};
3030

3131
use crate::errors::StoreError;
3232
use crate::records::{Check, CheckType, TARGETS};
@@ -358,9 +358,9 @@ impl Store {
358358

359359
// TODO: somehow account for old versions that are not compatible with the store struct
360360
if store.version != Version::CURRENT {
361-
error!("The store that was loaded is not of the current version:\nstore has {} but the current version is {}", store.version, Version::CURRENT);
361+
warn!("The store that was loaded is not of the current version:\nstore has {} but the current version is {}", store.version, Version::CURRENT);
362362
if Version::SUPPROTED.contains(&store.version) {
363-
error!("The old store version is still supported, migrating to newer version");
363+
warn!("The old store version is still supported, migrating to newer version (in memory, can be made permanent by saving)");
364364
store.version = Version::CURRENT;
365365
} else {
366366
error!("The store version is not supported");
@@ -385,6 +385,7 @@ impl Store {
385385
/// - Write fails
386386
/// - Serialization fails
387387
pub fn save(&self) -> Result<(), StoreError> {
388+
info!("Saving the store");
388389
let file = match fs::File::options()
389390
.read(false)
390391
.write(true)

0 commit comments

Comments
 (0)