Early review of std.logger
SomeDude
lovelydear at mailmetrash.com
Sun Oct 20 21:19:37 PDT 2013
On Tuesday, 15 October 2013 at 08:47:00 UTC, Robert Schadek wrote:
> On 10/15/2013 09:32 AM, Sönke Ludwig wrote:
>> Am 15.10.2013 09:08, schrieb Jacob Carlborg:
>>> On 2013-10-14 23:22, Dicebot wrote:
>>>
>>>> If we need to care about that, D module system is a failure.
>>>> But I don't think it is a valid concern.
>>>
>>> People already complain about conflict function names in
>>> Phobos.
>>>
>>
>> And I'd agree with them. At least inside of a library, care
>> IMO should
>> be taken to minimize overlap (of course functionally
>> equivalent ones
>> in different overload sets are fine, though). But in case of
>> "logXXX"
>> this seems to be very unlikely, much in contrast to "log"
>> (std.math.log).
> yes and no. Of course does logXXX create less conflict, but I
> like to
> simply write log and don't care about the LogLevel. So again
> pros and cons
I for once have never seen any log API with
log.level = INFO;
Logger.log("Here be dragons");
And this I believe for a good reason: in 99% of production code
I've seen, several log levels are mixed, i.e INFO, CRITICAL and
DEBUG for instance, so the case where a single log level is used,
even in the same method, just never happens. The proposed
solution looks extremely inconvenient to me as it will almost
always necessit two lines of code instead of one.
I am with Sönke on this one, as well as the need for multi logger
output. That's the absolute minimum requirement. If this doesn't
exist, what will happen is, someone will make something better.
More information about the Digitalmars-d
mailing list