What are, in your opinion, the pros/cons of the following extension method?
static class Log
{
public static string AddToLog(this string input)
{
Console.WriteLine(input);
return input;
}
public static string AddToLog(this string input, string format)
{
Console.WriteLine(format, input);
return input;
}
}
Usage scenario:
class Program
{
static void Main(string[] args)
{
string tableName = "Bills".AddToLog("Default table name is {0}");
"Starting...".AddToLog();
"Creating table".AddToLog();
}
}