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 1B09394F74 for ; Thu, 11 Apr 2024 15:08:25 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id EC7B831D97 for ; Thu, 11 Apr 2024 15:07:54 +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 for ; Thu, 11 Apr 2024 15:07:54 +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 0E7FF4424C for ; Thu, 11 Apr 2024 15:07:54 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 11 Apr 2024 15:07:53 +0200 Message-Id: From: "Gabriel Goller" Cc: To: "Wolfgang Bumiller" X-Mailer: aerc 0.17.0-91-g65332c233880-dirty References: <20240410141722.147895-1-g.goller@proxmox.com> <20240410141722.147895-4-g.goller@proxmox.com> In-Reply-To: X-SPAM-LEVEL: Spam detection results: 0 AWL -0.086 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [lib.rs] Subject: Re: [pbs-devel] [PATCH proxmox v3 3/3] proxmox-log: added tracing infra 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: Thu, 11 Apr 2024 13:08:25 -0000 On Thu Apr 11, 2024 at 2:08 PM CEST, Wolfgang Bumiller wrote: > On Wed, Apr 10, 2024 at 04:17:17PM +0200, Gabriel Goller wrote: > > diff --git a/proxmox-log/Cargo.toml b/proxmox-log/Cargo.toml > > new file mode 100644 > > index 0000000..e05b0be > > --- /dev/null > > +++ b/proxmox-log/Cargo.toml > > @@ -0,0 +1,23 @@ > > +[package] > > +name =3D "proxmox-log" > > +version =3D "0.1.0" > > +authors.workspace =3D true > > +edition.workspace =3D true > > +license.workspace =3D true > > +repository.workspace =3D true > > +description =3D "Logging infrastructure for proxmox" > > + > > +exclude.workspace =3D true > > + > > +[dependencies] > > +anyhow.workspace =3D true > > +syslog.workspace =3D true > > +nix.workspace =3D true > > +log.workspace =3D true > > +tracing.workspace =3D true > > +tracing-subscriber.workspace =3D true > > +tracing-log.workspace =3D true > > Technically we also need `features =3D [ "std" ]` here. Currently this is > pulled in by `tracing-subscriber` > ... > Setting it explicitly never hurt anybody :) > > diff --git a/proxmox-log/debian/copyright b/proxmox-log/debian/copyrigh= t > > new file mode 100644 > > index 0000000..0d9eab3 > > --- /dev/null > > +++ b/proxmox-log/debian/copyright > > @@ -0,0 +1,18 @@ > > +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/= 1.0/ > > + > > +Files: > > + * > > +Copyright: 2019 - 2023 Proxmox Server Solutions GmbH > > (2024) > Fixed. > > diff --git a/proxmox-log/src/lib.rs b/proxmox-log/src/lib.rs > > new file mode 100644 > > index 0000000..15fa22d > > --- /dev/null > > +++ b/proxmox-log/src/lib.rs > > @@ -0,0 +1,34 @@ > > +use std::{cell::RefCell, env}; > > +use syslog_tasklog_layer::SyslogAndTasklogLayer; > > +use tracing_log::{AsLog, LogTracer}; > > +use tracing_subscriber::filter::LevelFilter; > > +use tracing_subscriber::prelude::*; > > + > > +mod file_logger; > > +pub use file_logger::{FileLogOptions, FileLogger}; > > + > > +mod syslog_tasklog_layer; > > + > > +tokio::task_local! { > > + pub static LOGGER: RefCell; > > + pub static WARN_COUNTER: RefCell; > > `WARN_COUNTER` could just be a `Cell`. > Oooh, good catch! Pulled in all your other suggestions as well.