From: Shan Shaji <s.shaji@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH proxmox 1/1] proxmox-log: deprecate `tasklog_pbs` and add `tasklog` function
Date: Wed, 28 Jan 2026 14:54:55 +0100 [thread overview]
Message-ID: <20260128135457.245662-2-s.shaji@proxmox.com> (raw)
In-Reply-To: <20260128135457.245662-1-s.shaji@proxmox.com>
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
next prev parent reply other threads:[~2026-01-28 13:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=20260128135457.245662-2-s.shaji@proxmox.com \
--to=s.shaji@proxmox.com \
--cc=pdm-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.