public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: Wolfgang Bumiller <w.bumiller@proxmox.com>
Cc: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH proxmox v2] worker_task: write result message manually, bypassing tracing
Date: Tue, 18 Feb 2025 17:36:31 +0100	[thread overview]
Message-ID: <ke6hn5rc5erqs6qsxkyo5m4zdcnzhhv3w3yua6rykvbtz5jumu@2iuu67hhkblu> (raw)
In-Reply-To: <kfzvtzhuf2uu3tlxekemgcqtwmrqk24kdzbkifnj2srr4lgzsw@dbuq6xjs3c5m>

On 18.02.2025 16:05, Wolfgang Bumiller wrote:
>On Tue, Feb 18, 2025 at 03:52:26PM +0100, Gabriel Goller wrote:
>> diff --git a/proxmox-log/src/lib.rs b/proxmox-log/src/lib.rs
>> index 8c74e42b618d..755d1b4a850c 100644
>> --- a/proxmox-log/src/lib.rs
>> +++ b/proxmox-log/src/lib.rs
>> @@ -191,3 +191,20 @@ pub fn init_cli_logger(
>>      LogTracer::init_with_filter(log_level.as_log())?;
>>      Ok(())
>>  }
>> +
>> +/// Write manually to the current tasklog bypassing the whole tracing infrastructure. Note that this
>> +/// will also bypass all the filtering and writing to journald or elsewhere. If has_failed is true,
>> +/// print to stderr as well.
>> +pub fn log_manually_to_tasklog(msg: &str, has_failed: bool) -> Result<(), anyhow::Error> {
>
>What's "manual" about using a provided helper function? :-P

I thought of "manual" = "without tracing".

>Besides, the name kind of conflicts with the stderr write, which seems
>even more specific to the rest-server case.

True.

>Maybe a `LogContext::log_unfiltered(&str)` and rest-server just calls
>this+eprintln!()? Then the `error!()` invocation could be in a `None`
>match arm on the `LogContext::current()` match which IMO makes for much
>nicer control flow.

Damn, that's neat!

>Do we even anticipate any other use case than the one in rest-server?

Nope, not really, just this one.

Will submit a new patch with the changes soon!


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


      reply	other threads:[~2025-02-18 16:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-18 14:52 Gabriel Goller
2025-02-18 14:57 ` Gabriel Goller
2025-02-18 15:05 ` Wolfgang Bumiller
2025-02-18 16:36   ` Gabriel Goller [this message]

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=ke6hn5rc5erqs6qsxkyo5m4zdcnzhhv3w3yua6rykvbtz5jumu@2iuu67hhkblu \
    --to=g.goller@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=w.bumiller@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