mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-07 09:25:26 +00:00
pbs-datastore: replace print with log macro
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
e10fccf5cc
commit
dce4b5403b
@ -636,7 +636,7 @@ impl<R: Read + Seek> CatalogReader<R> {
|
|||||||
|
|
||||||
match etype {
|
match etype {
|
||||||
CatalogEntryType::Directory => {
|
CatalogEntryType::Directory => {
|
||||||
println!("{} {:?}", etype, path);
|
log::info!("{} {:?}", etype, path);
|
||||||
if offset > start {
|
if offset > start {
|
||||||
bail!("got wrong directory offset ({} > {})", offset, start);
|
bail!("got wrong directory offset ({} > {})", offset, start);
|
||||||
}
|
}
|
||||||
@ -649,10 +649,10 @@ impl<R: Read + Seek> CatalogReader<R> {
|
|||||||
mtime_string = s;
|
mtime_string = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("{} {:?} {} {}", etype, path, size, mtime_string,);
|
log::info!("{} {:?} {} {}", etype, path, size, mtime_string,);
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
println!("{} {:?}", etype, path);
|
log::info!("{} {:?}", etype, path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ impl DataStore {
|
|||||||
match serde_json::from_str(&state) {
|
match serde_json::from_str(&state) {
|
||||||
Ok(state) => state,
|
Ok(state) => state,
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
eprintln!("error reading gc-status: {}", err);
|
log::error!("error reading gc-status: {}", err);
|
||||||
GarbageCollectionStatus::default()
|
GarbageCollectionStatus::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -465,7 +465,7 @@ impl DynamicChunkWriter {
|
|||||||
self.stat.disk_size += compressed_size;
|
self.stat.disk_size += compressed_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
println!(
|
log::info!(
|
||||||
"ADD CHUNK {:016x} {} {}% {} {}",
|
"ADD CHUNK {:016x} {} {}% {} {}",
|
||||||
self.chunk_offset,
|
self.chunk_offset,
|
||||||
chunk_size,
|
chunk_size,
|
||||||
|
@ -51,7 +51,7 @@ unsafe impl Sync for FixedIndexReader {}
|
|||||||
impl Drop for FixedIndexReader {
|
impl Drop for FixedIndexReader {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
if let Err(err) = self.unmap() {
|
if let Err(err) = self.unmap() {
|
||||||
eprintln!("Unable to unmap file - {}", err);
|
log::error!("Unable to unmap file - {}", err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -144,16 +144,16 @@ impl FixedIndexReader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn print_info(&self) {
|
pub fn print_info(&self) {
|
||||||
println!("Size: {}", self.size);
|
log::info!("Size: {}", self.size);
|
||||||
println!("ChunkSize: {}", self.chunk_size);
|
log::info!("ChunkSize: {}", self.chunk_size);
|
||||||
|
|
||||||
let mut ctime_str = self.ctime.to_string();
|
let mut ctime_str = self.ctime.to_string();
|
||||||
if let Ok(s) = proxmox_time::strftime_local("%c", self.ctime) {
|
if let Ok(s) = proxmox_time::strftime_local("%c", self.ctime) {
|
||||||
ctime_str = s;
|
ctime_str = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("CTime: {}", ctime_str);
|
log::info!("CTime: {}", ctime_str);
|
||||||
println!("UUID: {:?}", self.uuid);
|
log::info!("UUID: {:?}", self.uuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,7 +247,7 @@ impl Drop for FixedIndexWriter {
|
|||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
let _ = std::fs::remove_file(&self.tmp_filename); // ignore errors
|
let _ = std::fs::remove_file(&self.tmp_filename); // ignore errors
|
||||||
if let Err(err) = self.unmap() {
|
if let Err(err) = self.unmap() {
|
||||||
eprintln!("Unable to unmap file {:?} - {}", self.tmp_filename, err);
|
log::error!("Unable to unmap file {:?} - {}", self.tmp_filename, err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -418,7 +418,7 @@ impl FixedIndexWriter {
|
|||||||
|
|
||||||
let digest = &chunk_info.digest;
|
let digest = &chunk_info.digest;
|
||||||
|
|
||||||
println!(
|
log::info!(
|
||||||
"ADD CHUNK {} {} {}% {} {}",
|
"ADD CHUNK {} {} {}% {} {}",
|
||||||
idx,
|
idx,
|
||||||
chunk_len,
|
chunk_len,
|
||||||
|
@ -63,7 +63,7 @@ pub fn generate_paper_key<W: Write>(
|
|||||||
(lines, false)
|
(lines, false)
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
eprintln!("Couldn't parse data as KeyConfig - {}", err);
|
log::error!("Couldn't parse data as KeyConfig - {}", err);
|
||||||
bail!("Neither a PEM-formatted private key, nor a PBS key file.");
|
bail!("Neither a PEM-formatted private key, nor a PBS key file.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user