[mtouch] Add logging overloads that don't format the input. (#5525)
Sometimes we just Log a string without any format arguments. This works fine, until the string comes from the user, and happen to contain braces, in which case an invalid format exception is thrown. Adding Log overloads that doesn't take format arguments (nor formats its input) avoids this problem.
This commit is contained in:
Родитель
204361d62e
Коммит
510bb0b1cd
|
@ -149,11 +149,24 @@ namespace Xamarin.Bundler
|
||||||
|
|
||||||
static string mtouch_dir;
|
static string mtouch_dir;
|
||||||
|
|
||||||
|
public static void Log (string value)
|
||||||
|
{
|
||||||
|
Log (0, value);
|
||||||
|
}
|
||||||
|
|
||||||
public static void Log (string format, params object [] args)
|
public static void Log (string format, params object [] args)
|
||||||
{
|
{
|
||||||
Log (0, format, args);
|
Log (0, format, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void Log (int min_verbosity, string value)
|
||||||
|
{
|
||||||
|
if (min_verbosity > verbose)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Console.WriteLine (value);
|
||||||
|
}
|
||||||
|
|
||||||
public static void Log (int min_verbosity, string format, params object [] args)
|
public static void Log (int min_verbosity, string format, params object [] args)
|
||||||
{
|
{
|
||||||
if (min_verbosity > verbose)
|
if (min_verbosity > verbose)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче