mirror of https://github.com/dswd/zvault
Some fixes
This commit is contained in:
parent
545523e5ce
commit
d5b033c85a
|
@ -8,7 +8,7 @@ struct Logger;
|
||||||
|
|
||||||
impl log::Log for Logger {
|
impl log::Log for Logger {
|
||||||
fn enabled(&self, metadata: &LogMetadata) -> bool {
|
fn enabled(&self, metadata: &LogMetadata) -> bool {
|
||||||
metadata.level() <= LogLevel::Debug
|
metadata.level() <= LogLevel::Info
|
||||||
}
|
}
|
||||||
|
|
||||||
fn log(&self, record: &LogRecord) {
|
fn log(&self, record: &LogRecord) {
|
||||||
|
@ -27,7 +27,7 @@ impl log::Log for Logger {
|
||||||
|
|
||||||
pub fn init() -> Result<(), SetLoggerError> {
|
pub fn init() -> Result<(), SetLoggerError> {
|
||||||
log::set_logger(|max_log_level| {
|
log::set_logger(|max_log_level| {
|
||||||
max_log_level.set(LogLevelFilter::Debug);
|
max_log_level.set(LogLevelFilter::Info);
|
||||||
Box::new(Logger)
|
Box::new(Logger)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,8 +108,10 @@ fn print_inode(inode: &Inode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_backups(backup_map: &HashMap<String, Backup>) {
|
fn print_backups(backup_map: &HashMap<String, Backup>) {
|
||||||
for (name, backup) in backup_map {
|
let mut backups: Vec<_> = backup_map.into_iter().collect();
|
||||||
println!("{:40} {:>32} {:5} files, {:4} dirs, {:>10}",
|
backups.sort_by_key(|b| b.0);
|
||||||
|
for (name, backup) in backups {
|
||||||
|
println!("{:40} {:>32} {:7} files, {:6} dirs, {:>10}",
|
||||||
name, Local.timestamp(backup.date, 0).to_rfc2822(), backup.file_count,
|
name, Local.timestamp(backup.date, 0).to_rfc2822(), backup.file_count,
|
||||||
backup.dir_count, to_file_size(backup.total_data_size));
|
backup.dir_count, to_file_size(backup.total_data_size));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue