My point is that log4net should not throw exceptions what so ever.
- Morten
Matthew Brown wrote:
Not that it matters to your original point, but I think
that simple concatenation of strings for the log statement is often a
lot faster than using String.Format anyway...
On 3/15/06, Morten
I think I have to agree with Morton. Were this anything other than a
logging tool, I would flame Morton for inadequate test coverage.
However, the log4net claims that it shouldn't throw exceptions, and
there shouldn't be any argument here: Per log4net docs, this is a
serious bug.
In an Appeal to
--- Cliff Burger [EMAIL PROTECTED] wrote:
By fail-stop, we mean that log4net will not throw unexpected
exceptions at run-time potentially causing your application to crash.
The documentation for String.Format says that if the format is invalid
or the number indicating an argument to format is
The problem is not that String.Format is throwing an uncaught exception,
that is an implementation detail. The problem is that the API has thrown
an exception and it is suppose to be fail-safe.
The multiple interface idea complicates the API.
What is wrong with Option 4 suggested by Cliff Burger
I would debate itis more thanannoying ifa
production application crashes because of this type of exception. It
seemslikelyapplication datapassed into the format method could
be null.
IfI need to check for null values or catch exceptions
when I use the API then it is not fail-safe. If I
FormatException thrown when *Format methods are given a malformed format
string: log.DebugFormat(Malformed {{,,,5}format{8}!);
Key: LOG4NET-69
URL:
[ http://issues.apache.org/jira/browse/LOG4NET-69?page=all ]
Ron Grabowski updated LOG4NET-69:
-
Description:
This statement:
log.DebugFormat(Malformed {{,,,5}format{8}!);
throws the following exception:
[FormatException: Input string was not in a
log.DebugFormat(Hello {0}! Where is {1}?, Morten);
109 [10] DEBUG WindowsApplication1.Program (null) - Hello {0}! Where is {1}?
arg0: Morten
LogImpl.cs
virtual public void DebugFormat(string format, params object[]
args)
{
if (IsDebugEnabled)
{