Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to log output of StartPowershellFile #18

Closed
DixonDs opened this issue Feb 24, 2017 · 2 comments
Closed

Failure to log output of StartPowershellFile #18

DixonDs opened this issue Feb 24, 2017 · 2 comments

Comments

@DixonDs
Copy link

DixonDs commented Feb 24, 2017

See the stacktrace:

System.FormatException: Input string was not in a correct format.
   at Cake.Diagnostics.Formatting.FormatParser.ParseProperty(TextReader reader)
   at Cake.Diagnostics.Formatting.FormatParser.<Parse>d__0.MoveNext()
   at Cake.Diagnostics.CakeBuildLog.Write(Verbosity verbosity, LogLevel level, String format, Object[] args)
   at Cake.Core.Diagnostics.LogExtensions.Debug(ICakeLog log, Verbosity verbosity, String format, Object[] args)
   at Cake.Powershell.PowershellRunner.Invoke(String script, PowershellSettings settings)
   at Submission#0.StartPowershellFile(FilePath path, PowershellSettings settings)
   at Submission#0.<.ctor>b__15()
   at Cake.Core.CakeTaskBuilderExtensions.<>c__DisplayClass5_0.<Does>b__0(ICakeContext context)
   at Cake.Core.ActionTask.Execute(ICakeContext context)
   at Cake.Core.DefaultExecutionStrategy.Execute(CakeTask task, ICakeContext context)
   at Cake.Core.CakeEngine.ExecuteTask(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask
task, CakeReport report)

It looks like to be related to this part:

if (settings.LogOutput)
{
	foreach (PSObject res in results)
	{
		_Log.Debug(Verbosity.Normal, res.ToString());
	}
}

Probably. since Cake logging supports format strings, it could be a matter of escaping of curly braces in res.ToString() before passing it to logs.

@SharpeRAD
Copy link
Owner

I've pushed an update that I think will solve this, if you run it again using v0.3.0

@DixonDs
Copy link
Author

DixonDs commented Feb 27, 2017

@SharpeRAD It solves the error, but there is some minor issue: {} from the powershell output printed as {{}}. But I guess that is something that could be fixed in core Cake only, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants