-
Notifications
You must be signed in to change notification settings - Fork 22
Yevhen Bobrov edited this page Apr 3, 2020
·
2 revisions
Shortcut methods for printing messages to console.
using static Nake.Log;
// prints trace-level message using specified format string and arguments
// the message will be printed in 'DarkGreen' color and
// will be printed only if Nake is called with '--trace' switch
TraceFormat("Foo {0}", "bar");
// version without string format
Trace("Foo");
// prints simple message using specified format string and arguments
// the message will be printed in 'DarkCyan' color
MessageFormat("Foo {0}", "bar");
// version without string format
Message("Foo");
// prints informational message using specified format string and arguments
// the message will be printed in DarkGray color
InfoFormat("Foo {0}", "bar");
// version without string format
Info("Foo");
// prints error message using specified exception as input
// the message will be printed in DarkRed color and
// stack trace will be printed only if Nake is called with --trace switch
Error(exc);
// prints error message in DarkRed color
Error("Foo");
// you could substitute default Out in order to redirect messages
Out = (text) => File.AppendText("log.txt", text);