public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup] log: adjust log level on sync job messages
Date: Tue, 26 Nov 2024 16:55:00 +0100	[thread overview]
Message-ID: <20241126155500.457797-1-g.goller@proxmox.com> (raw)

Some messages printed on a sync push job should have been logged in the
syslog as well. These are clearly errors, so they should also be printed
accordingly.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
 src/server/pull.rs |  4 ++--
 src/server/push.rs | 28 ++++++++++++++--------------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/server/pull.rs b/src/server/pull.rs
index 9abb673aea00..8afeec46350a 100644
--- a/src/server/pull.rs
+++ b/src/server/pull.rs
@@ -8,7 +8,7 @@ use std::time::SystemTime;
 
 use anyhow::{bail, format_err, Error};
 use proxmox_human_byte::HumanByte;
-use tracing::info;
+use tracing::{info, error};
 
 use pbs_api_types::{
     print_store_and_ns, ArchiveType, Authid, BackupArchiveName, BackupDir, BackupGroup,
@@ -837,7 +837,7 @@ pub(crate) async fn pull_store(mut params: PullParameters) -> Result<SyncStats,
             }
             Err(err) => {
                 errors = true;
-                info!(
+                error!(
                     "Encountered errors while syncing namespace {} - {err}",
                     &namespace,
                 );
diff --git a/src/server/push.rs b/src/server/push.rs
index 99757a3cc355..dcb238c06190 100644
--- a/src/server/push.rs
+++ b/src/server/push.rs
@@ -7,7 +7,7 @@ use anyhow::{bail, Context, Error};
 use futures::stream::{self, StreamExt, TryStreamExt};
 use tokio::sync::mpsc;
 use tokio_stream::wrappers::ReceiverStream;
-use tracing::{info, warn};
+use tracing::{info, warn, error};
 
 use pbs_api_types::{
     print_store_and_ns, ApiVersion, ApiVersionInfo, ArchiveType, Authid, BackupArchiveName,
@@ -429,8 +429,8 @@ pub(crate) async fn push_store(mut params: PushParameters) -> Result<SyncStats,
             }
             Err(err) => {
                 errors = true;
-                info!("Encountered errors: {err:#}");
-                info!("Failed to sync {source_store_and_ns} into {target_store_and_ns}!");
+                error!("Encountered errors: {err:#}");
+                error!("Failed to sync {source_store_and_ns} into {target_store_and_ns}!");
             }
         }
     }
@@ -478,8 +478,8 @@ pub(crate) async fn push_store(mut params: PushParameters) -> Result<SyncStats,
                     }
                 }
                 Err(err) => {
-                    warn!("Encountered errors: {err:#}");
-                    warn!("Failed to remove vanished namespace {target_namespace} from remote!");
+                    error!("Encountered errors: {err:#}");
+                    error!("Failed to remove vanished namespace {target_namespace} from remote!");
                     continue;
                 }
             }
@@ -554,8 +554,8 @@ pub(crate) async fn push_namespace(
         match push_group(params, namespace, &group, &mut progress).await {
             Ok(sync_stats) => stats.add(sync_stats),
             Err(err) => {
-                warn!("Encountered errors: {err:#}");
-                warn!("Failed to push group {group} to remote!");
+                error!("Encountered errors: {err:#}");
+                error!("Failed to push group {group} to remote!");
                 errors = true;
             }
         }
@@ -587,8 +587,8 @@ pub(crate) async fn push_namespace(
                     }));
                 }
                 Err(err) => {
-                    warn!("Encountered errors: {err:#}");
-                    warn!("Failed to remove vanished group {target_group} from remote!");
+                    error!("Encountered errors: {err:#}");
+                    error!("Failed to remove vanished group {target_group} from remote!");
                     errors = true;
                     continue;
                 }
@@ -748,8 +748,8 @@ pub(crate) async fn push_group(
                     );
                 }
                 Err(err) => {
-                    warn!("Encountered errors: {err:#}");
-                    warn!(
+                    error!("Encountered errors: {err:#}");
+                    error!(
                         "Failed to remove vanished snapshot {name} from remote!",
                         name = snapshot.backup
                     );
@@ -793,8 +793,8 @@ pub(crate) async fn push_snapshot(
         Ok((manifest, _raw_size)) => manifest,
         Err(err) => {
             // No manifest in snapshot or failed to read, warn and skip
-            log::warn!("Encountered errors: {err:#}");
-            log::warn!("Failed to load manifest for '{snapshot}'!");
+            error!("Encountered errors: {err:#}");
+            error!("Failed to load manifest for '{snapshot}'!");
             return Ok(stats);
         }
     };
@@ -816,7 +816,7 @@ pub(crate) async fn push_snapshot(
     if fetch_previous_manifest {
         match backup_writer.download_previous_manifest().await {
             Ok(manifest) => previous_manifest = Some(Arc::new(manifest)),
-            Err(err) => log::info!("Could not download previous manifest - {err}"),
+            Err(err) => info!("Could not download previous manifest - {err}"),
         }
     };
 
-- 
2.39.5



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


                 reply	other threads:[~2024-11-26 15:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241126155500.457797-1-g.goller@proxmox.com \
    --to=g.goller@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal