From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] dmd: Allow storing early logs before writing to disk Date: Fri, 19 Sep 2014 09:57:32 +0200 Message-ID: <87a95woxeb.fsf@gnu.org> References: <87d2b36nak.fsf@gmail.com> <87sijyqldj.fsf@gnu.org> <87ha0bk95q.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUt4a-0004i6-Px for guix-devel@gnu.org; Fri, 19 Sep 2014 03:57:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUt4V-0006Ld-8J for guix-devel@gnu.org; Fri, 19 Sep 2014 03:57:44 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:50916) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUt4V-0006L5-1x for guix-devel@gnu.org; Fri, 19 Sep 2014 03:57:39 -0400 In-Reply-To: (David Michael's message of "Wed, 17 Sep 2014 17:36:23 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: David Michael Cc: guix-devel@gnu.org David Michael skribis: > On Sat, Sep 13, 2014 at 8:16 AM, Ludovic Court=C3=A8s wrot= e: >> David Michael skribis: >>> On Thu, Sep 11, 2014 at 10:31 AM, Ludovic Court=C3=A8s w= rote: > [snip] >>>> The ideal thing would be: >>>> >>>> 1. Run =E2=80=98dmd -l foo.log=E2=80=99. >>>> 2. If foo.log is not writable, then make =E2=80=98log-output-port=E2= =80=99 a string >>>> port. >>> >>> Do you think it makes sense to define log-output-port as a string port >>> at first instead of a void port? >> >> No, because running dmd without =E2=80=98-l=E2=80=99 means disabling log= ging altogether, >> hence the void port. > > That doesn't appear to be the case. The main procedure in > modules/dmd.scm is calling start-logging unconditionally, with the > default log file if the option is omitted. Oh indeed, you=E2=80=99re right. [...] >> So probably the patch you propose is the best approach. >> >> Then I would suggest a small change: instead of the magic >> =E2=80=98--log-file=3Ddelayed=E2=80=99, what about adding a new option, = say, >> =E2=80=98--buffered-log=E2=80=99? WDYT? > > Yes, I think a separate option would be better. If it's expected that > users will handle early mount configuration in their dmdconf.scm, > separate options could allow doing something like specifying both > options and starting to write to the given log file automatically > after processing dmdconf.scm, if it wasn't started explicitly. That > could at least remove the need for the user to have to know to start > logging themselves. Rather, I would expect that the service that mounts the file system /var/log is on would explicitly call =E2=80=98start-logging=E2=80=99 (becau= se it could be that things aren=E2=80=99t ready yet after dmdconf.scm has been loaded.) > I haven't had a chance to try rewriting this yet, but I can send a new > version when I do. Great, thanks. Ludo=E2=80=99.