std.log available for viewing

Steven Schveighoffer schveiguy at yahoo.com
Tue May 31 12:09:07 PDT 2011


On Tue, 31 May 2011 14:48:57 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> On 5/31/11 1:32 PM, Steven Schveighoffer wrote:
>> On Tue, 31 May 2011 14:10:20 -0400, Jose Armando Garcia
>> <jsancio at gmail.com> wrote:
>>
>>> On Tue, May 31, 2011 at 2:34 PM, Steven Schveighoffer
>>> <schveiguy at yahoo.com> wrote:
>>
>>>> Again, this sounds way too complicated for what it's giving you
>>>> (avoiding
>>>> having to forcibly kill your application if that's what you desire).
>>>> If I
>>>> had to choose from your options, I'd use neither critical nor fatal.  
>>>> I'd
>>>> probably just stick with the higher levels, and start putting my own
>>>> levels
>>>> in as strings to avoid what I'd consider to be "buggy" behavior...
>>>>
>>>> From my own experience, I almost never *never* use a forced kill. A
>>>> graceful shutdown works much better. Remember that a 'fatal' error is
>>>> not
>>>> so much a "this program can't continue because it's not sane," but a
>>>> "this
>>>> program cannot continue because something is misconfigured, etc."
>>>> This does
>>>> not warrant raw destruction.
>>>>
>>>
>>> That is probably because most programmers write web application in
>>> which independent request/processing are all handle by the same
>>> process. So by definition since requests are independent it is unfair
>>> for one request to affect another request (by asserting) because they
>>> share the same process. Not everyone writes application using that
>>> model. If your programming model is such (or architecture if you
>>> prefer that word ;), then yes using fatal("") is not wise but maybe
>>> critical("") and error("") is.
>>
>> If critical throws, then it is also of no use. I want to control when
>> exceptions are thrown, I don't want exceptions or program halting to be
>> the tax for using the logging facility.
>>
>> I can see this pattern emerging:
>>
>> try
>> {
>> logCritical("critical error encountered!");
>> }
>> catch(Exception e){} // stupid std.log...
>
> I don't understand this. You are at the same time using logCritical,  
> which has as its MAIN distinction from logError the fact that it throws,  
> to then complain about that very distinction and manually arrange things  
> to be identical.

I'm operating under the assumption that logCritical and logFatal are at a  
different log level (i.e. the primary function of a logging facility is to  
have different degrees of importance, which you can turn on or off  
depending on the level set).  Is that not the case?  So I can't have a  
situation where logError does nothing, but logCritical logs a message?

If that is not the case, I have no problem with the functionality.  I will  
re-examine the API more closely.  I just did a quick skim after reading  
Brad's message.

-Steve


More information about the Digitalmars-d mailing list