From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 3B95F5A004E for ; Fri, 21 Jun 2024 11:34:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718962478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8MhIiBRQBW0zduYtQVRpvj2gOoblhWCr2WyqGHe/N0c=; b=MH1hHPnRLr6Dtw9vxiKjEDtDTYR/Lz7VtWNiLsL2n6R5NjOkhzFx/EdACHgxIluY81foWw Ep4x4isDAPdkENTaERdfWzGtq+yLjdotfFEaiglxc6qkyc2FkSxK9Dqzpca20fTSXvwide EdqKmn8uzF0G0Zy9fxm9ZIb1lMk+y4Q= Received: from mail-oi1-f197.google.com (mail-oi1-f197.google.com [209.85.167.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-463-MH6EQOxtOyCqSbP8A_LJcA-1; Fri, 21 Jun 2024 05:34:36 -0400 X-MC-Unique: MH6EQOxtOyCqSbP8A_LJcA-1 Received: by mail-oi1-f197.google.com with SMTP id 5614622812f47-3d216db4182so1893576b6e.1 for ; Fri, 21 Jun 2024 02:34:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718962476; x=1719567276; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8MhIiBRQBW0zduYtQVRpvj2gOoblhWCr2WyqGHe/N0c=; b=cNzuDiq3ueUHyToPGgmZLm6pP0bKKOC2fdtzNlrdPXchf0g5uSGu3Eg570l8VmiGqs ufJ5S45Z0XYhqtAvjJoM7hv0EM/vcb8uTWLtmB23PYfvWhOlxNWl32XlUoja7z4ZdeC+ /opZvZnkhhFkPbbiWaBfILGv5NH1N2ut2V7ForX9R10mphgAXhcM8hBwxPvrQBYHgpf9 DCT+NeWJJk5VUKQbJpuqnK8GPVXgKxmNQFN47uDHABXwrPej7E0cl9+6qRBOE3QJUdqj 5r5n+8dI2VuEPt8AMxRm6Btl/Qta5vuwIVLCm20LcAuRd0ICxQBhwbTAZaNTFyqmTzFR J7/Q== X-Gm-Message-State: AOJu0YzsppiIY5y4zXhlsm62QstNv/1SSR/GuXr79mJWxqdf3UQxZGql KaJ4Lms5T0WAB/9nIOdlN+WLaCU22WQnA9psQvndQDS2VjyyeP0BJA63627+2irptz2pwacCqBu k0K//zc99FGQ5+xehEBdo97hfHUH7oByhM0ZLUY4uJCIGkipd4g== X-Received: by 2002:a05:6808:1793:b0:3d5:10c6:30a2 with SMTP id 5614622812f47-3d51b997ed4mr8298916b6e.16.1718962475753; Fri, 21 Jun 2024 02:34:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5ZB60dP/AyZZ5vwf8m+ZOQfg0vi7HfLy1jS4k0KzEKJ0vmDi5HDXv6n8MVdxeJfboe2dUtQ== X-Received: by 2002:a05:6808:1793:b0:3d5:10c6:30a2 with SMTP id 5614622812f47-3d51b997ed4mr8298897b6e.16.1718962475232; Fri, 21 Jun 2024 02:34:35 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id af79cd13be357-79bce8b0d9csm69217885a.31.2024.06.21.02.34.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Jun 2024 02:34:34 -0700 (PDT) Date: Fri, 21 Jun 2024 11:33:55 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v5 0/9] Fixes for early logging/prints and related cleanups Message-ID: <20240621113348.246d9564@elisabeth> In-Reply-To: References: <20240620161518.142285-1-sbrivio@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: EXM5Y6ROSW7QSNU3OPIVMGNLJK76D7D2 X-Message-ID-Hash: EXM5Y6ROSW7QSNU3OPIVMGNLJK76D7D2 X-MailFrom: sbrivio@redhat.com 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: On Fri, 21 Jun 2024 11:17:34 +1000 David Gibson wrote: > On Thu, Jun 20, 2024 at 06:15:09PM +0200, Stefano Brivio wrote: > > 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 anymore, > > during initialisation, which means that users such as libvirt lost > > the ability to report meaningful error messages that occurred during > > initialisation, in that case. > > > > 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 debugging > > pasta when it spawns its own shell becomes rather impractical > > 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 point > that having pasta messages appear in your pasta-spawned shell is ugly. > > My preferred approach for that would to keep the basic semantics that > 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. That's already the default, see pasta_start_ns(): if (!c->debug) c->quiet = 1; 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. Before and after this series (v5, but not v4), if you pass a log file, that debug output stays in the log file. If you don't give a log file, debug information will printed to stderr as usual. -- Stefano