Fix option values and log output

This commit is contained in:
Viktor Hofer
2019-04-26 01:46:45 +02:00
parent f9dc78bb13
commit cdfe540f22
+4 -4
View File
@@ -28,7 +28,7 @@ namespace Coverlet.Console
CommandOption target = app.Option("-t|--target", "Path to the test runner application.", CommandOptionType.SingleValue);
CommandOption targs = app.Option("-a|--targetargs", "Arguments to be passed to the test runner.", CommandOptionType.SingleValue);
CommandOption output = app.Option("-o|--output", "Output of the generated coverage report", CommandOptionType.SingleValue);
CommandOption<LogLevel> verbosity = app.Option<LogLevel>("-v|--verbosity", "Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed].", CommandOptionType.SingleValue);
CommandOption<LogLevel> verbosity = app.Option<LogLevel>("-v|--verbosity", "Sets the verbosity level of the command. Allowed values are quiet, minimal, normal, detailed.", CommandOptionType.SingleValue);
CommandOption formats = app.Option("-f|--format", "Format of the generated coverage report.", CommandOptionType.MultipleValue);
CommandOption threshold = app.Option("--threshold", "Exits with error if the coverage % is below value.", CommandOptionType.SingleValue);
CommandOption thresholdTypes = app.Option("--threshold-type", "Coverage type to apply the threshold to.", CommandOptionType.MultipleValue);
@@ -124,8 +124,8 @@ namespace Coverlet.Console
if (reporter.OutputType == ReporterOutputType.Console)
{
// Output to console
logger.LogInformation(" Outputting results to console");
logger.LogInformation(reporter.Report(result));
logger.LogInformation(" Outputting results to console", important: true);
logger.LogInformation(reporter.Report(result), important: true);
}
else
{
@@ -135,7 +135,7 @@ namespace Coverlet.Console
filename = Path.HasExtension(filename) ? filename : $"{filename}.{reporter.Extension}";
var report = Path.Combine(directory, filename);
logger.LogInformation($" Generating report '{report}'");
logger.LogInformation($" Generating report '{report}'", important: true);
File.WriteAllText(report, reporter.Report(result));
}
}