[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:
Rolf Bjarne Kvinge 2019-02-01 07:43:15 +01:00 коммит произвёл GitHub
Родитель 204361d62e
Коммит 510bb0b1cd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -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)