示例#1
0
        protected TextWriter SetupOutputSink(ProcessRunner runner, string tags = null, string messagePrefix = null)
        {
            string logFilePath = null;

            if (!String.IsNullOrEmpty(tags))
            {
                logFilePath = Context.GetLogFilePath(tags ?? String.Empty);
                if (String.IsNullOrEmpty(messagePrefix))
                {
                    messagePrefix = "running";
                }
                Log.StatusLine($"{LogMessageIndent}[{ToolName}] {messagePrefix}");
                Log.StatusLine($"[{ToolName}] log file: ", $"{Utilities.GetRelativePath (BuildPaths.XamarinAndroidSourceRoot, logFilePath)}", tailColor: Log.DestinationColor);
            }

            TextWriter ret = CreateLogSink(logFilePath);

            runner.AddStandardErrorSink(ret);
            runner.AddStandardOutputSink(ret);

            return(ret);
        }