www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Why fatal log throw object.Error (0) on console?

reply Suliman <evermind live.ru> writes:
import std.stdio;
import std.experimental.logger;

void main()
{
	sharedLog = new FileLogger("New_Default_Log_File.log");

	fatal("Fatal error: ");
}

All other log-levels write as expected log files, but `fatal` 
throw on console:

 app.exe
object.Error (0): A fatal log message was logged ---------------- 0x0041291E 0x004138E7 0x0040206C 0x0040B277 0x0040B178 0x00407AB3 0x73FC62C4 in BaseThreadInitThunk 0x77440FD9 in RtlSubscribeWnfStateChangeNotification 0x77440FA4 in RtlSubscribeWnfStateChangeNotification It's bug normal behavoiur?
Jan 30 2017
parent reply Suliman <evermind live.ru> writes:
I found in the docs mention "If data is logged with LogLevel 
fatal by default an Error will be thrown.". But what the reason 
of such behavior?
Jan 30 2017
parent =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
On 01/30/2017 05:21 AM, Suliman wrote:
 I found in the docs mention "If data is logged with LogLevel fatal by
 default an Error will be thrown.". But what the reason of such behavior?
That likely comes from the fact that 'fatal' describes states that you can't trust the program to do the right thing. For example, you may not be able to write to a log file. Fatal means fatal. :) Ali
Jan 30 2017