[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] dmd: Allow storing early logs before writing to disk
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] dmd: Allow storing early logs before writing to disk |
Date: |
Fri, 19 Sep 2014 09:57:32 +0200 |
User-agent: |
Gnus/5.130011 (Ma Gnus v0.11) Emacs/24.3 (gnu/linux) |
David Michael <address@hidden> skribis:
> On Sat, Sep 13, 2014 at 8:16 AM, Ludovic Courtès <address@hidden> wrote:
>> David Michael <address@hidden> skribis:
>>> On Thu, Sep 11, 2014 at 10:31 AM, Ludovic Courtès <address@hidden> wrote:
> [snip]
>>>> The ideal thing would be:
>>>>
>>>> 1. Run ‘dmd -l foo.log’.
>>>> 2. If foo.log is not writable, then make ‘log-output-port’ 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 ‘-l’ means disabling logging 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’re right.
[...]
>> So probably the patch you propose is the best approach.
>>
>> Then I would suggest a small change: instead of the magic
>> ‘--log-file=delayed’, what about adding a new option, say,
>> ‘--buffered-log’? 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 ‘start-logging’ (because it could
be that things aren’t 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’.