public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pdm-devel] [PATCH datacenter-manager/proxmox{, -backup} 0/3] refactor: log: deprecate tasklog_pbs and replace its usages with tasklog
@ 2026-01-28 13:54 Shan Shaji
  2026-01-28 13:54 ` [pdm-devel] [PATCH proxmox 1/1] proxmox-log: deprecate `tasklog_pbs` and add `tasklog` function Shan Shaji
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shan Shaji @ 2026-01-28 13:54 UTC (permalink / raw)
  To: pdm-devel

The tasklog_pbs function was used in both PBS and PDM. Since it's not
specific to PBS anymore, this patch series deprecates the same and
replaces all its call sites on both PBS and PDM with the new tasklog
function.

proxmox:

Shan Shaji (1):
  proxmox-log: deprecate `tasklog_pbs` and add `tasklog` function

 proxmox-log/src/builder.rs | 12 +++++++++++-
 proxmox-log/src/lib.rs     |  8 ++++----
 2 files changed, 15 insertions(+), 5 deletions(-)


proxmox-datacenter-manager:

Shan Shaji (1):
  refactor: log: replace use of `tasklog_pbs` with `tasklog`

 server/src/bin/proxmox-datacenter-api/main.rs             | 2 +-
 server/src/bin/proxmox-datacenter-manager-daily-update.rs | 2 +-
 server/src/bin/proxmox-datacenter-privileged-api.rs       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)


proxmox-backup:

Shan Shaji (1):
  refactor: log: replace use of `tasklog_pbs` with `tasklog`

 src/bin/proxmox-backup-api.rs     | 2 +-
 src/bin/proxmox-backup-manager.rs | 2 +-
 src/bin/proxmox-backup-proxy.rs   | 2 +-
 src/bin/proxmox-daily-update.rs   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)


Summary over all repositories:
  9 files changed, 22 insertions(+), 12 deletions(-)

-- 
Generated by git-murpp 0.8.1


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pdm-devel] [PATCH proxmox 1/1] proxmox-log: deprecate `tasklog_pbs` and add `tasklog` function
  2026-01-28 13:54 [pdm-devel] [PATCH datacenter-manager/proxmox{, -backup} 0/3] refactor: log: deprecate tasklog_pbs and replace its usages with tasklog Shan Shaji
@ 2026-01-28 13:54 ` Shan Shaji
  2026-01-28 13:54 ` [pdm-devel] [PATCH datacenter-manager 1/1] refactor: log: replace use of `tasklog_pbs` with `tasklog` Shan Shaji
  2026-01-28 13:54 ` [pdm-devel] [PATCH proxmox-backup " Shan Shaji
  2 siblings, 0 replies; 4+ messages in thread
From: Shan Shaji @ 2026-01-28 13:54 UTC (permalink / raw)
  To: pdm-devel

The `tasklog_pbs` function was used for both PBS and PDM. The name of the
function was specific to PBS. Since the function is no longer
PBS-specific, introduce a new `tasklog` function and deprecate
`tasklog_pbs`.

Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
 proxmox-log/src/builder.rs | 12 +++++++++++-
 proxmox-log/src/lib.rs     |  8 ++++----
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/proxmox-log/src/builder.rs b/proxmox-log/src/builder.rs
index 70616ce7..5d8bdcb3 100644
--- a/proxmox-log/src/builder.rs
+++ b/proxmox-log/src/builder.rs
@@ -35,7 +35,7 @@ impl<S> Filter<S> for NoWorkerTask {
 /// // The default PBS daemon/proxy logger
 /// Logger::from_env("PBS_LOG", LevelFilter::INFO)
 ///     .journald_on_no_workertask()
-///     .tasklog_pbs()
+///     .tasklog()
 ///     .init()?;
 /// # Ok(())
 /// # }
@@ -102,12 +102,22 @@ impl Logger {
     /// Print to the PBS tasklog if we are in a PBS workertask.
     ///
     /// Check if a LogContext exists and if it does, print to the corresponding task log file.
+    #[deprecated(note = "use `tasklog` instead")]
     pub fn tasklog_pbs(mut self) -> Logger {
         self.layer
             .push(TasklogLayer {}.with_filter(self.global_log_level).boxed());
         self
     }
 
+    /// Print to the task log file if we are in a workertask.
+    ///
+    /// Check if a LogContext exists and if it does, print to the corresponding task log file.
+    pub fn tasklog(mut self) -> Logger {
+        self.layer
+            .push(TasklogLayer {}.with_filter(self.global_log_level).boxed());
+        self
+    }
+
     /// Print to stderr.
     ///
     /// Prints all the events to stderr with the compact format (no level, no timestamp).
diff --git a/proxmox-log/src/lib.rs b/proxmox-log/src/lib.rs
index 3a529cca..86e3f69e 100644
--- a/proxmox-log/src/lib.rs
+++ b/proxmox-log/src/lib.rs
@@ -162,7 +162,7 @@ fn get_env_variable(env_var: &str, default_log_level: LevelFilter) -> LevelFilte
     log_level
 }
 
-/// Initialize tracing logger that prints to journald or stderr depending on if we are in a pbs
+/// Initialize tracing logger that prints to journald or stderr depending on if we are in a worker
 /// task.
 ///
 /// Check the (tokio) LogContext and print to either journald or the Tasklog.
@@ -173,13 +173,13 @@ pub fn init_logger(
 ) -> Result<(), anyhow::Error> {
     Logger::from_env(env_var_name, default_log_level)
         .journald_on_no_workertask()
-        .tasklog_pbs()
+        .tasklog()
         .init()
 }
 
 /// Initialize default tracing logger for CLI binaries.
 ///
-/// Prints to stderr and to the tasklog if we are in a pbs workertask.
+/// Prints to stderr and to the tasklog if we are in a workertask.
 #[deprecated(note = "Use the `Logger` builder instead")]
 pub fn init_cli_logger(
     env_var_name: &str,
@@ -187,6 +187,6 @@ pub fn init_cli_logger(
 ) -> Result<(), anyhow::Error> {
     Logger::from_env(env_var_name, default_log_level)
         .stderr_on_no_workertask()
-        .tasklog_pbs()
+        .tasklog()
         .init()
 }
-- 
2.47.3



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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pdm-devel] [PATCH datacenter-manager 1/1] refactor: log: replace use of `tasklog_pbs` with `tasklog`
  2026-01-28 13:54 [pdm-devel] [PATCH datacenter-manager/proxmox{, -backup} 0/3] refactor: log: deprecate tasklog_pbs and replace its usages with tasklog Shan Shaji
  2026-01-28 13:54 ` [pdm-devel] [PATCH proxmox 1/1] proxmox-log: deprecate `tasklog_pbs` and add `tasklog` function Shan Shaji
@ 2026-01-28 13:54 ` Shan Shaji
  2026-01-28 13:54 ` [pdm-devel] [PATCH proxmox-backup " Shan Shaji
  2 siblings, 0 replies; 4+ messages in thread
From: Shan Shaji @ 2026-01-28 13:54 UTC (permalink / raw)
  To: pdm-devel

The `tasklog_pbs` function was used on both PBS and PDM. Since the
function was not specific to PBS anymore, the same has been deprecated
and added a new `tasklog` function inside the proxmox-log crate.

To avoid deprecation warning replaced all call sites of
`tasklog_pbs` with `tasklog` function.

Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
 server/src/bin/proxmox-datacenter-api/main.rs             | 2 +-
 server/src/bin/proxmox-datacenter-manager-daily-update.rs | 2 +-
 server/src/bin/proxmox-datacenter-privileged-api.rs       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/src/bin/proxmox-datacenter-api/main.rs b/server/src/bin/proxmox-datacenter-api/main.rs
index 524a4b5..bafbe02 100644
--- a/server/src/bin/proxmox-datacenter-api/main.rs
+++ b/server/src/bin/proxmox-datacenter-api/main.rs
@@ -50,7 +50,7 @@ fn main() -> Result<(), Error> {
 
     proxmox_log::Logger::from_env("PROXMOX_DEBUG", LevelFilter::INFO)
         .journald_on_no_workertask()
-        .tasklog_pbs()
+        .tasklog()
         .init()?;
 
     if std::env::args().nth(1).is_some() {
diff --git a/server/src/bin/proxmox-datacenter-manager-daily-update.rs b/server/src/bin/proxmox-datacenter-manager-daily-update.rs
index 8b6641c..a7c7547 100644
--- a/server/src/bin/proxmox-datacenter-manager-daily-update.rs
+++ b/server/src/bin/proxmox-datacenter-manager-daily-update.rs
@@ -110,7 +110,7 @@ fn main() {
     // We need to use the tasklog layer here because we call a workertask.
     proxmox_log::Logger::from_env("PDM_LOG", proxmox_log::LevelFilter::INFO)
         .journald_on_no_workertask()
-        .tasklog_pbs()
+        .tasklog()
         .init()
         .expect("unable to initialize logger");
 
diff --git a/server/src/bin/proxmox-datacenter-privileged-api.rs b/server/src/bin/proxmox-datacenter-privileged-api.rs
index 6b490f2..0f2b509 100644
--- a/server/src/bin/proxmox-datacenter-privileged-api.rs
+++ b/server/src/bin/proxmox-datacenter-privileged-api.rs
@@ -27,7 +27,7 @@ fn main() -> Result<(), Error> {
 
     proxmox_log::Logger::from_env("PROXMOX_DEBUG", LevelFilter::INFO)
         .journald_on_no_workertask()
-        .tasklog_pbs()
+        .tasklog()
         .init()?;
 
     proxmox_product_config::init(pdm_config::api_user()?, pdm_config::priv_user()?);
-- 
2.47.3



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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pdm-devel] [PATCH proxmox-backup 1/1] refactor: log: replace use of `tasklog_pbs` with `tasklog`
  2026-01-28 13:54 [pdm-devel] [PATCH datacenter-manager/proxmox{, -backup} 0/3] refactor: log: deprecate tasklog_pbs and replace its usages with tasklog Shan Shaji
  2026-01-28 13:54 ` [pdm-devel] [PATCH proxmox 1/1] proxmox-log: deprecate `tasklog_pbs` and add `tasklog` function Shan Shaji
  2026-01-28 13:54 ` [pdm-devel] [PATCH datacenter-manager 1/1] refactor: log: replace use of `tasklog_pbs` with `tasklog` Shan Shaji
@ 2026-01-28 13:54 ` Shan Shaji
  2 siblings, 0 replies; 4+ messages in thread
From: Shan Shaji @ 2026-01-28 13:54 UTC (permalink / raw)
  To: pdm-devel

The `tasklog_pbs` function was used on both PBS and PDM. Since the
function was not specific to PBS anymore, the same has been deprecated
and added a new `tasklog` function inside the proxmox-log crate.
To avoid deprecation warning replaced all call sites of
`tasklog_pbs` with `tasklog` function.

Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
 src/bin/proxmox-backup-api.rs     | 2 +-
 src/bin/proxmox-backup-manager.rs | 2 +-
 src/bin/proxmox-backup-proxy.rs   | 2 +-
 src/bin/proxmox-daily-update.rs   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/bin/proxmox-backup-api.rs b/src/bin/proxmox-backup-api.rs
index 417e9e97..922fc77e 100644
--- a/src/bin/proxmox-backup-api.rs
+++ b/src/bin/proxmox-backup-api.rs
@@ -44,7 +44,7 @@ fn get_index() -> Pin<Box<dyn Future<Output = Response<Body>> + Send>> {
 async fn run() -> Result<(), Error> {
     proxmox_log::Logger::from_env("PBS_LOG", LevelFilter::INFO)
         .journald_on_no_workertask()
-        .tasklog_pbs()
+        .tasklog()
         .init()?;
 
     config::create_configdir()?;
diff --git a/src/bin/proxmox-backup-manager.rs b/src/bin/proxmox-backup-manager.rs
index f8365070..b2f09170 100644
--- a/src/bin/proxmox-backup-manager.rs
+++ b/src/bin/proxmox-backup-manager.rs
@@ -663,7 +663,7 @@ async fn run() -> Result<(), Error> {
     // will directly execute workertasks.
     proxmox_log::Logger::from_env("PBS_LOG", proxmox_log::LevelFilter::INFO)
         .stderr_on_no_workertask()
-        .tasklog_pbs()
+        .tasklog()
         .init()?;
     proxmox_backup::server::notifications::init()?;
     proxmox_product_config::init(pbs_config::backup_user()?, pbs_config::priv_user()?);
diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs
index 870208fe..482f3a1a 100644
--- a/src/bin/proxmox-backup-proxy.rs
+++ b/src/bin/proxmox-backup-proxy.rs
@@ -181,7 +181,7 @@ async fn get_index_future(env: RestEnvironment, parts: Parts) -> Response<Body>
 async fn run() -> Result<(), Error> {
     proxmox_log::Logger::from_env("PBS_LOG", LevelFilter::INFO)
         .journald_on_no_workertask()
-        .tasklog_pbs()
+        .tasklog()
         .init()?;
 
     proxmox_backup::auth_helpers::setup_auth_context(false);
diff --git a/src/bin/proxmox-daily-update.rs b/src/bin/proxmox-daily-update.rs
index 224103cc..8b82c6c6 100644
--- a/src/bin/proxmox-daily-update.rs
+++ b/src/bin/proxmox-daily-update.rs
@@ -113,7 +113,7 @@ fn main() {
     // We need to use the tasklog layer here because we call a workertask.
     proxmox_log::Logger::from_env("PBS_LOG", proxmox_log::LevelFilter::INFO)
         .journald_on_no_workertask()
-        .tasklog_pbs()
+        .tasklog()
         .init()
         .expect("unable to initialize logger");
 
-- 
2.47.3



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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-28 13:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-28 13:54 [pdm-devel] [PATCH datacenter-manager/proxmox{, -backup} 0/3] refactor: log: deprecate tasklog_pbs and replace its usages with tasklog Shan Shaji
2026-01-28 13:54 ` [pdm-devel] [PATCH proxmox 1/1] proxmox-log: deprecate `tasklog_pbs` and add `tasklog` function Shan Shaji
2026-01-28 13:54 ` [pdm-devel] [PATCH datacenter-manager 1/1] refactor: log: replace use of `tasklog_pbs` with `tasklog` Shan Shaji
2026-01-28 13:54 ` [pdm-devel] [PATCH proxmox-backup " Shan Shaji

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