[pdm-devel] [PATCH proxmox 1/1] proxmox-log: deprecate `tasklog_pbs` and add `tasklog` function

Shan Shaji s.shaji at proxmox.com
Wed Jan 28 14:54:55 CET 2026


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 at 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





More information about the pdm-devel mailing list