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.133.124]) by passt.top (Postfix) with ESMTP id 3CA545A004F for ; Tue, 18 Jun 2024 08:01:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718690504; 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=/yOOUQScJW34nVR1QKcP+H4cF7Fm0BZsVGQkxW441nY=; b=fJfC9yCsMoN55hFfv1iNTaWz4AOF+ePr54Y6+7gedpS+DVO7Dm3NExP6g/r3rmqqp3ZFma dMdib9YhdZb+m6vFytgMLTHKQmnxIdNFmhI39QjaMbtOzFrOR0aC1jR+/Gm+uL473QRmH5 QOTm3DN8guXNJbC2ewRbwzPhj70Oo+A= Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-620-vECmuRuxP0SN5-pq0DdSUA-1; Tue, 18 Jun 2024 02:01:42 -0400 X-MC-Unique: vECmuRuxP0SN5-pq0DdSUA-1 Received: by mail-vk1-f197.google.com with SMTP id 71dfb90a1353d-4ed0d775598so2410674e0c.1 for ; Mon, 17 Jun 2024 23:01:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718690502; x=1719295302; 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=/yOOUQScJW34nVR1QKcP+H4cF7Fm0BZsVGQkxW441nY=; b=DUvBruG5mOoj1p0lAcERk7z5PMQETCqNDY6csWKJtx/kXfgnKaiPXTdCuuY5cPrbah 3ECppvdp+bpe+418GwBZY3/gBGXSdCv4g3YOd4e4CMoRucdlKgn0C1oscj3NltGRnbMO KsCRcxfq7gcwXRTh5ZcicJg1o+rMa44F088J2PAfH1XM304tJcqMD/+GHbVcQhHLUlJN HpDa2MeKoICNBnJ0L0pB1sx/KeDWTX8CDNsSrU7tnN8ftsuqKNVpcZpK9nby0DqWT6k9 5aYcGI5yveUGlJPvhRWE8ISgJIWxA0ZoMmBZjsgmucgZwMIYjxiL/3vRS7/7elnSVLxc WhIQ== X-Gm-Message-State: AOJu0YzWg20jLvOzahsHGn3Zz1d01jirWtRjsu7WeRV3HTBaB8rWQZKz 9OwPUfNnt7SjLY7OrN0VcXNOi7wxVzg9wzbfTHeuWr+r68AeiHhJzYZNGCd7UTPjelrZdDO2vI4 SVnIykPgoE6fi3uk+IDzFfhiIt3C5fWCKvE29fCM7VCE/vH8Wbw== X-Received: by 2002:a05:6122:46a6:b0:4ec:f996:5d84 with SMTP id 71dfb90a1353d-4ee3e2943ccmr10801857e0c.2.1718690501797; Mon, 17 Jun 2024 23:01:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZPMY8OIq8Nmays6kPW5Dz/pnOUomUlfntzh8aRw8E5j8WYuiu42QwXVVF+IGtXi6a7HOKhw== X-Received: by 2002:a05:6122:46a6:b0:4ec:f996:5d84 with SMTP id 71dfb90a1353d-4ee3e2943ccmr10801835e0c.2.1718690501322; Mon, 17 Jun 2024 23:01:41 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-441ef4f9a9esm53522671cf.31.2024.06.17.23.01.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2024 23:01:40 -0700 (PDT) Date: Tue, 18 Jun 2024 08:01:06 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 2/6] conf, log: Introduce internal log flags, instead of abusing log levels Message-ID: <20240618080058.45f7b93b@elisabeth> In-Reply-To: References: <20240617120319.1206857-1-sbrivio@redhat.com> <20240617120319.1206857-3-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: ERVYI3UTIKOYT57IQHEQ677WGIY4ONGF X-Message-ID-Hash: ERVYI3UTIKOYT57IQHEQ677WGIY4ONGF 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 Tue, 18 Jun 2024 10:39:13 +1000 David Gibson wrote: > On Mon, Jun 17, 2024 at 02:03:15PM +0200, Stefano Brivio wrote: > > We currently use a LOG_EMERG log mask to represent the fact that we > > don't know yet what the mask resulting from configuration should be, > > before the command line is parsed. > > > > However, we have the necessity of representing another phase as well, > > that is, configuration is parsed but we didn't daemonise yet, or > > we're not ready for operation yet. The next patch will add that > > notion explicitly. > > > > Mapping these cases to further log levels isn't really practical. > > Introduce internal log flags to represent them, instead of abusing > > log priorities. > > > > Signed-off-by: Stefano Brivio > > I like not abusing the log priorities. But, do we actually need a > flags field with constants and helpers, rather than just > bool log_conf_parsed; > and open code it from there? Right, we probably don't need a flags field. I went this way because I thought I needed more than two flags, originally, but I can't see that happening after all, so I'll switch to two boolean flags. -- Stefano