[phobos] User define datetime format

Andrei Alexandrescu andrei at erdani.com
Tue Jun 7 06:47:45 PDT 2011


On 6/6/11 10:41 PM, Jose Armando Garcia wrote:
> On Tue, Jun 7, 2011 at 12:03 AM, Andrei Alexandrescu<andrei at erdani.com>  wrote:
>> Jose,
>>
>>
>> I suggest you use simple Posix positional parameters. Jonathan has a few
>> tips on how to make that fast. You should be able to get many formats that
>> way.
>>
>
> I am planning to use positional parameters internally but I didn't
> want the user to have to remember that %1$s is for timestamp, %2$x is
> for thread id, etc. So instead I was thinking of having the user input
> "%t %i" which internally gets translated to "%1$s %2$x" (I already
> have the code for this).

Fine, but this is chaff IMHO. Changing the format of the log line is 
done by a specialist once, by looking at the manual. Inventing a new 
convention with its own quirks has its own problems - and people will 
need to look at the manual anyway!

> Andrei, do you plan to submit your changes to formattedWrite which
> allow a range of arguments. I can simplify some of my code with such a
> feature ;)!

Oops, I thought I did.


Andrei


More information about the phobos mailing list