String.Format style signatures

Sep 21, 2011 at 11:03 PM

Was reading the Art of Logging (http://www.codeproject.com/KB/trace/ArtOfLogging.aspx) and saw nice pattern they recommended:

ILogger.Info(string format, params object[] args), which follows theString.Format() pattern of replacing tokens in a string, makes it even easier to include this information as part of a formatted message.

Didn't see this type of signature for Logger.Info, .Debug, etc. so figured this could be nice tweak to add to your nice Logging framework!

Cheers,

JD

Sep 22, 2011 at 12:58 AM

My bad...I just realized you do have this pattern like so:

Log.InfoFormat("obj1 is {0}.", obj1);

Nice!!