I am qurious about all the overloads on the Logger class methods. What is the purpose of all of them?
When I look in the API documentation it appears as though the arguments are only parsed into the string message. But since string.Format() does not offer all of these overloads why does the NLog Logger? Is there some logic here that you can explain to me? Is there some perf gain somewhere that I cannot see?
See the example from your API documentation below!
Example: Logger.Debug(string, int) public void Debug(string message, int argument)
Member of NLog.Logger
Writes the diagnostic message at the Debug level using the specified System.Int32 as a parameter.
message: A string containing one format item.
argument: The System.Int32 argument to format.
Re: What is the purpose of all the Logger overloads?
The overloads are mainly for performance reason. This is to avoid boxing of common types of parameters if logging is disabled. Believe it or not, but it actually makes a lot of difference in a tight loop when logging is disabled.
In NLog 1.x there was a ton of overloads for each common parameter type but some were left out, in NLog 2.x I added a generic overload which handles all parameter types, but overloads from NLog 1.x had to stay because of backwards compatibility.