Ensure Flax.Build tasks and utilities output error messages as errors
This commit is contained in:
@@ -237,7 +237,7 @@ namespace Flax.Build.BuildSystem.Graph
|
|||||||
CreateNoWindow = true,
|
CreateNoWindow = true,
|
||||||
};
|
};
|
||||||
process.OutputDataReceived += ProcessDebugOutput;
|
process.OutputDataReceived += ProcessDebugOutput;
|
||||||
process.ErrorDataReceived += ProcessDebugOutput;
|
process.ErrorDataReceived += ProcessDebugError;
|
||||||
process.Start();
|
process.Start();
|
||||||
|
|
||||||
process.BeginOutputReadLine();
|
process.BeginOutputReadLine();
|
||||||
@@ -273,5 +273,14 @@ namespace Flax.Build.BuildSystem.Graph
|
|||||||
Log.Info(output);
|
Log.Info(output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void ProcessDebugError(object sender, DataReceivedEventArgs e)
|
||||||
|
{
|
||||||
|
string output = e.Data;
|
||||||
|
if (output != null)
|
||||||
|
{
|
||||||
|
Log.Error(output);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -423,6 +423,14 @@ namespace Flax.Build
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void StdLogError(object sender, DataReceivedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Data != null)
|
||||||
|
{
|
||||||
|
Log.Error(e.Data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void StdLogVerbose(object sender, DataReceivedEventArgs e)
|
private static void StdLogVerbose(object sender, DataReceivedEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Data != null)
|
if (e.Data != null)
|
||||||
@@ -513,7 +521,7 @@ namespace Flax.Build
|
|||||||
if (options.HasFlag(RunOptions.ConsoleLogOutput))
|
if (options.HasFlag(RunOptions.ConsoleLogOutput))
|
||||||
{
|
{
|
||||||
proc.OutputDataReceived += StdLogInfo;
|
proc.OutputDataReceived += StdLogInfo;
|
||||||
proc.ErrorDataReceived += StdLogInfo;
|
proc.ErrorDataReceived += StdLogError;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user