one of my subscribers sent me a message directing this post via letterbox. the original (on the left) and the broadly translated one (on the right) versions are present on the screenshot
first of all, what if you want to log.Fatal (or even log.Panic? is it called this way? i dont actually remember) multiple lines? e.g. your log line is so long it's better to split it up into two lines. so you would normally do something like this: log.Fatal('... this is the first line');
log.Fatal('... this is the second line');
... expected (!) handling further ... but you would quickly see that your second line of logs would never be executed because of this non-explicit exiting behavior
secondly, "there will be a hint when you will be writing log.Fatal indicating that os.Exit is called under the hood". and what about those half of programmers that don't use IDEs and code editors that splash with a hint every now and then? this logic must be as simple as possible and as obvious as possible: log.Fatal means log`ging on a `Fatal error, nothing else. period. why the fuck does an os.Exit call even happen? for what reason?
thirdly, "just use Error" — why should i use not what i wanted to use? why are there some assumptions what and whatnot to use? i want to use fatal logging level (of course you know about logging levels, right? right???) and that's all, i dont want a logger to unexpectedly exit my program because golang developers went nuts when creating this language
damn this went into a brag really quick, kinda sorry for that
first of all, what if you want to log.Fatal (or even log.Panic? is it called this way? i dont actually remember) multiple lines? e.g. your log line is so long it's better to split it up into two lines. so you would normally do something like this: log.Fatal('... this is the first line');
log.Fatal('... this is the second line');
... expected (!) handling further ... but you would quickly see that your second line of logs would never be executed because of this non-explicit exiting behavior
secondly, "there will be a hint when you will be writing log.Fatal indicating that os.Exit is called under the hood". and what about those half of programmers that don't use IDEs and code editors that splash with a hint every now and then? this logic must be as simple as possible and as obvious as possible: log.Fatal means log`ging on a `Fatal error, nothing else. period. why the fuck does an os.Exit call even happen? for what reason?
thirdly, "just use Error" — why should i use not what i wanted to use? why are there some assumptions what and whatnot to use? i want to use fatal logging level (of course you know about logging levels, right? right???) and that's all, i dont want a logger to unexpectedly exit my program because golang developers went nuts when creating this language
damn this went into a brag really quick, kinda sorry for that