Review of Jose Armando Garcia Sancio's std.log

Geoffrey Biggs geoffrey.biggs at aist.go.jp
Mon Mar 12 05:45:53 PDT 2012


On Mar 12, 2012, at 7:28 AM, Andrei Alexandrescu wrote:

> On 3/11/12 4:49 PM, David Nadlinger wrote:
>> Unfortunately, the discussion has ground to a halt again, so consider
>> this a friendly reminder that there is still one day left until the end
>> of the review period.
>> 
>> David
> 
> I thought more about the point made about mixing throwing and logging levels. I agree that it's awkward to e.g. log to critical without throwing etc. I personally think in that case you really want the error log, but hey, point taken.
> 
> Here's a suggestion:
> 
> * Don't throw from the critical log and don't abort from the fatal log.
> 
> * Define the logging functions such that logging an exception will log its toString() and then throw the exception.
> 
> * Regarding static import log = std.log, I suggest we keep course.
> 
> Works?


+1

(I particularly like the idea of logging an exception rather than logging a message and a separate exception to throw, which may contain a different message.)


Geoff


More information about the Digitalmars-d mailing list