* [pbs-devel] [PATCH proxmox] notify: remove irritating 'html template not found' log message
@ 2024-11-26 9:30 Lukas Wagner
2024-11-26 11:09 ` [pbs-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 3+ messages in thread
From: Lukas Wagner @ 2024-11-26 9:30 UTC (permalink / raw)
To: pbs-devel
The proxmox-notify crate can render notification text based on two
different templates, plaintext and html. The html template is at the
moment only used for email-based notifications. If we try to render
a html-formatted message but there is no html template, we try to
fall back to the plaintext template and wrap the rendered message
in <pre> tags.
As a preparation for user-supplied/overridden templates, I added a log
message "html template not found, falling back to plaintext ..." to
educate the user about this behavior.
In Proxmox Backup Server, we only ship plaintext templates at the
moment, meaning that this log message will be shown for every single
(email) notification that is sent out. This might be a bit confusing,
because the log message can be interpreted as an error, which it isn't.
This commit removes the log message completely for now. Once we add
support for user-overridable notification templates we could consider
adding it back it, but maybe phrased a bit differently, to avoid it
being interpreted as an error.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
proxmox-notify/src/renderer/mod.rs | 1 -
1 file changed, 1 deletion(-)
diff --git a/proxmox-notify/src/renderer/mod.rs b/proxmox-notify/src/renderer/mod.rs
index 82473d03..393cbbf2 100644
--- a/proxmox-notify/src/renderer/mod.rs
+++ b/proxmox-notify/src/renderer/mod.rs
@@ -290,7 +290,6 @@ pub fn render_template(
(None, TemplateType::HtmlBody) => {
ty = TemplateType::PlaintextBody;
let plaintext_filename = format!("{template}-{suffix}", suffix = ty.file_suffix());
- log::info!("html template '{filename}' not found, falling back to plain text template '{plaintext_filename}'");
(
context::context().lookup_template(&plaintext_filename, None)?,
true,
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* [pbs-devel] applied: [PATCH proxmox] notify: remove irritating 'html template not found' log message
2024-11-26 9:30 [pbs-devel] [PATCH proxmox] notify: remove irritating 'html template not found' log message Lukas Wagner
@ 2024-11-26 11:09 ` Thomas Lamprecht
2024-11-26 11:46 ` Lukas Wagner
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Lamprecht @ 2024-11-26 11:09 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Lukas Wagner
Am 26.11.24 um 10:30 schrieb Lukas Wagner:
> The proxmox-notify crate can render notification text based on two
> different templates, plaintext and html. The html template is at the
> moment only used for email-based notifications. If we try to render
> a html-formatted message but there is no html template, we try to
> fall back to the plaintext template and wrap the rendered message
> in <pre> tags.
> As a preparation for user-supplied/overridden templates, I added a log
> message "html template not found, falling back to plaintext ..." to
> educate the user about this behavior.
>
> In Proxmox Backup Server, we only ship plaintext templates at the
> moment, meaning that this log message will be shown for every single
> (email) notification that is sent out. This might be a bit confusing,
> because the log message can be interpreted as an error, which it isn't.
>
> This commit removes the log message completely for now. Once we add
> support for user-overridable notification templates we could consider
> adding it back it, but maybe phrased a bit differently, to avoid it
> being interpreted as an error.
>
> Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
> ---
> proxmox-notify/src/renderer/mod.rs | 1 -
> 1 file changed, 1 deletion(-)
>
>
applied, thanks!
Anything pending for the notify crate? As else I'd do a bump now already.
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-26 11:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-26 9:30 [pbs-devel] [PATCH proxmox] notify: remove irritating 'html template not found' log message Lukas Wagner
2024-11-26 11:09 ` [pbs-devel] applied: " Thomas Lamprecht
2024-11-26 11:46 ` Lukas Wagner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox