Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make logging look a little nicer #143

Merged
merged 2 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use serde::{Deserialize, Serialize};

use crate::filesystem;

use core::fmt;
use std::collections::{BTreeMap, BTreeSet};
use std::fs;
use std::path::{Path, PathBuf};
Expand All @@ -14,6 +15,15 @@ pub enum UnixUser {
Name(String),
}

impl fmt::Display for UnixUser {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
UnixUser::Uid(uid) => write!(f, "{}", uid),
UnixUser::Name(name) => write!(f, "{}", name),
}
}
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
#[serde(deny_unknown_fields)]
pub struct SymbolicTarget {
Expand Down
2 changes: 1 addition & 1 deletion src/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ impl Filesystem for RealFilesystem {
));

let success = self
.sudo(format!("Setting owner of {:?} to {:?}...", file, owner))
.sudo(format!("setting owner of {:?} to user \"{}\"", file, owner))
.arg("chown")
.arg(owner.as_chown_arg())
.arg("-h") // no-dereference
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ fn run() -> Result<bool> {
.set_location_level(LevelFilter::Debug)
.set_target_level(LevelFilter::Off)
.set_thread_level(LevelFilter::Off)
.set_level_padding(simplelog::LevelPadding::Left)
samchouse marked this conversation as resolved.
Show resolved Hide resolved
.add_filter_allow("dotter".into())
.build(),
simplelog::TerminalMode::Mixed,
Expand Down