From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id E755573F2F for ; Tue, 31 May 2022 10:42:25 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DB706651B for ; Tue, 31 May 2022 10:42:25 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id C0A976510 for ; Tue, 31 May 2022 10:42:24 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 8FD9C422A1 for ; Tue, 31 May 2022 10:42:24 +0200 (CEST) Date: Tue, 31 May 2022 10:42:22 +0200 From: Wolfgang Bumiller To: Hannes Laimer Cc: pbs-devel@lists.proxmox.com Message-ID: <20220531084222.p5bkw45vovdareet@casey.proxmox.com> References: <20220510090158.33504-1-h.laimer@proxmox.com> <20220510090158.33504-10-h.laimer@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220510090158.33504-10-h.laimer@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.328 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pbs-devel] [PATCH proxmox-backup rebased 8/9] replace print with log macro X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2022 08:42:26 -0000 On Tue, May 10, 2022 at 09:01:57AM +0000, Hannes Laimer wrote: > diff --git a/pxar-bin/src/main.rs b/pxar-bin/src/main.rs > index bad68f24..e96ea13e 100644 > --- a/pxar-bin/src/main.rs > +++ b/pxar-bin/src/main.rs (...) > @@ -419,24 +397,16 @@ async fn mount_archive(archive: String, mountpoint: String, verbose: bool) -> Re > archive: { > description: "Archive name.", > }, > - verbose: { > - description: "Verbose output.", > - optional: true, > - default: false, > - }, > }, > }, > )] > /// List the contents of an archive. > -fn dump_archive(archive: String, verbose: bool) -> Result<(), Error> { > +fn dump_archive(archive: String) -> Result<(), Error> { > for entry in pxar::decoder::Decoder::open(archive)? { > let entry = entry?; > > - if verbose { > - println!("{}", format_single_line_entry(&entry)); > - } else { > - println!("{:?}", entry.path()); > - } > + log::debug!("{}", format_single_line_entry(&entry)); > + log::info!("{:?}", entry.path()); ^ here is probably also better to keep the condition with `log_enabled!(Debug)` rather than having double the lines in debug mode. > } > Ok(()) > }