From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id D21EF5A004E for ; Wed, 26 Jun 2024 04:08:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1719367692; bh=FpvXpZel5RQIE1hyZf75PeUrxDQryE6OSn/4N8s2kx4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HHxlUwlOgGnSmVjWWubpndfx6ZmnO/63J1XaokwmPgYAzuwIR+q4uyw0ex7xmTYMJ 1ClinpyvJy77KhtihXUQnf90jlA0LjnqD9kMzW48dDYq1zUH3IVaqdP6pjeOVQejWX WA9CTrBYRvZyeSwDfhkKz/+E9jt3HJKlVURcyQe6bCiU5saE3dtg0m/Uwi8vbPBhVT BZGxQZZge7EP5zAshx5H4HFx55Bfvrsiqq+939CET+xOmdw2Ua3Namsct+hAB+sLtm +PYvHt8WMN2YQzIm88CAINrjQZQYifU+WIiGYAEoZ0M0Bc3DuSttoSk/odA9y+9fIw wAV8p/H2E9w/w== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4W84qJ4PZ5z4wc8; Wed, 26 Jun 2024 12:08:12 +1000 (AEST) Date: Wed, 26 Jun 2024 11:50:03 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v5 0/9] Fixes for early logging/prints and related cleanups Message-ID: References: <20240620161518.142285-1-sbrivio@redhat.com> <20240621113348.246d9564@elisabeth> <20240624114521.45638044@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qnR0yqskt65Jvqf1" Content-Disposition: inline In-Reply-To: <20240624114521.45638044@elisabeth> Message-ID-Hash: MK6SKMQZCJMUOO3DXPML4F5JWLFJDKCB X-Message-ID-Hash: MK6SKMQZCJMUOO3DXPML4F5JWLFJDKCB X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, Yalan Zhang X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --qnR0yqskt65Jvqf1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 24, 2024 at 11:45:32AM +0200, Stefano Brivio wrote: > On Mon, 24 Jun 2024 15:32:20 +1000 > David Gibson wrote: >=20 > > On Fri, Jun 21, 2024 at 11:33:55AM +0200, Stefano Brivio wrote: > > > On Fri, 21 Jun 2024 11:17:34 +1000 > > > David Gibson wrote: > > > =20 > > > > On Thu, Jun 20, 2024 at 06:15:09PM +0200, Stefano Brivio wrote: =20 > > > > > The most apparent issue fixed by this series is the one from 4/6:= with > > > > > a log file configured, we wouldn't print to standard error anymor= e, > > > > > during initialisation, which means that users such as libvirt lost > > > > > the ability to report meaningful error messages that occurred dur= ing > > > > > initialisation, in that case. > > > > >=20 > > > > > v5: > > > > > - in 4/8, rename the new flag once more to 'log_runtime': we don't > > > > > want to log to standard error if we're running in foreground, a > > > > > log file is given, and initialisation is done, otherwise debugg= ing > > > > > pasta when it spawns its own shell becomes rather impractical = =20 > > > >=20 > > > > Ah.. right. See, I still think the semantics of always printing to > > > > stderr when foreground make more sense, but I guess I do see the po= int > > > > that having pasta messages appear in your pasta-spawned shell is ug= ly. > > > >=20 > > > > My preferred approach for that would to keep the basic semantics th= at > > > > we always log to stderr when foreground, but when we're spawning a > > > > pasta shell we default to 'quiet' log level. That way if you really > > > > do want messages to stderr along with your shell/command (which I > > > > sometimes do), you can get that by using --debug or whatever. =20 > > >=20 > > > That's already the default, see pasta_start_ns(): > > >=20 > > > if (!c->debug) > > > c->quiet =3D 1; > > >=20 > > > the problem is that if you want to debug something, and use a pasta > > > shell (which is the most indicated way to debug something in most > > > cases, I would say), you would usually pass --debug and a log file. = =20 > >=20 > > Oh... good point. > >=20 > > > Before and after this series (v5, but not v4), if you pass a log file, > > > that debug output stays in the log file. > > >=20 > > > If you don't give a log file, debug information will printed to stderr > > > as usual. =20 > >=20 > > I understand the choice in the short term, but this still doesn't feel > > quite right to me. > >=20 > > I'm wondering if we should treat spawning a a pasta command as though > > we're going into the background. It's not in the Unix technical > > sense, but it is going to the background in the loose sense that pasta > > is no longer the thing that the user is primarily looking at on this > > terminal. > >=20 > > But then, it would be nice to have a way to force output to stderr > > even with a pasta command - I find that pretty useful when debugging a > > specific problem, particularly when using a specific command rather > > than a shell. Maybe we could allow "-l -" or "-l stderr" or something > > with a special meaning? >=20 > But that's already the case if you give --debug (or --trace) but no log > file, isn't that enough? It's the case now, but wouldn't be if we treated spawning a pasta shell like going into the background, although that approach seems more sensible to to me in other ways. Eh, I can't quickly see a better way than what you have now, so never mind. --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --qnR0yqskt65Jvqf1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmZ7c8oACgkQzQJF27ox 2GerrQ/+Jjm+/PTMzOgkFzzstfwGJi4jTbYr4wjmgNMPssvQmsMvLwR8oNsF5B3N gjcc5Z35H4kR5A/m94up8IQQfBRkFjFVFZBpX5NPUfVAg4rddooqblN8JXMt9i7v sS41lvZNM53eTwyIARwtdFdAqJ964G7c9W+jH57QmTAHAnCQd2fm8z0b9RLkcAPi Ckmp7CPRMJDI3t4gvHPdvGlkMdTh2VsH9rIp0MQ7tpQb+Rv1Enhu7zN85LU5qm5f E8sUxivYvl7X5Wn0ln6COauM1XY77BGoCTcwCHiJ4Fjr7vmboZGq5EMFcJBvLdHQ qtmPkllUMVUmbRkEhpSilTuiAh/bfv5iIpztnClOqbjjvLpE4Rarj3KbOM4zfM7n Ub66Up3wD2KQQJlZqHryLDAnoZB8En1LuE+F48ekXncSXJ6rQNc9TKmXL3N4N2pq Nk0qeXyu8KzTgrnkDwLA2oIxLXLx2fAEwEemno38kQ7Yuqn4N3sels8oV/QdaICV CFQYylnGHEndrJ30Mgc73QiNEzno+PFcqcqpHyQFGqXAzxRhrJXOlMcRLpyCckrQ RcGpjuDSzpRNQ5xGWM822fyXeizHGbaP6JuqRf2lTHlg36tu2ozIeXBw05lmxq/x w0W4nflFK3hT6LgtLVeunGo0m+bS1P00/Enzewsl4evKc6WYFh4= =cix6 -----END PGP SIGNATURE----- --qnR0yqskt65Jvqf1--