提交 907e1135 编写于 作者: K Kevin Ransom (msft) 提交者: Don Syme

Fix In IDE Build logging. (#3609)

* Fix in ide build logging.

* Fix in ide build logging.
上级 966bd7f7
...@@ -158,7 +158,7 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden ...@@ -158,7 +158,7 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
let mutable subsystemVersion : string = null let mutable subsystemVersion : string = null
let mutable tailcalls : bool = true let mutable tailcalls : bool = true
let mutable targetProfile : string = null let mutable targetProfile : string = null
let mutable targetType : string = null let mutable targetType : string = null
let mutable toolExe : string = "fsc.exe" let mutable toolExe : string = "fsc.exe"
let mutable toolPath : string = let mutable toolPath : string =
let locationOfThisDll = let locationOfThisDll =
...@@ -277,7 +277,7 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden ...@@ -277,7 +277,7 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
| "WINEXE" -> "winexe" | "WINEXE" -> "winexe"
| "MODULE" -> "module" | "MODULE" -> "module"
| _ -> null) | _ -> null)
// NoWarn // NoWarn
match disabledWarnings with match disabledWarnings with
| null -> () | null -> ()
...@@ -418,7 +418,7 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden ...@@ -418,7 +418,7 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
// --noframework // --noframework
member fsc.NoFramework member fsc.NoFramework
with get() = noFramework with get() = noFramework
and set(b) = noFramework <- b and set(b) = noFramework <- b
// --optimize // --optimize
member fsc.Optimize member fsc.Optimize
...@@ -543,7 +543,7 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden ...@@ -543,7 +543,7 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
member fsc.Win32ManifestFile member fsc.Win32ManifestFile
with get() = win32manifest with get() = win32manifest
and set(m) = win32manifest <- m and set(m) = win32manifest <- m
// For specifying the warning level (0-4) // For specifying the warning level (0-4)
member fsc.WarningLevel member fsc.WarningLevel
with get() = warningLevel with get() = warningLevel
...@@ -552,7 +552,7 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden ...@@ -552,7 +552,7 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
member fsc.WarningsAsErrors member fsc.WarningsAsErrors
with get() = warningsAsErrors with get() = warningsAsErrors
and set(s) = warningsAsErrors <- s and set(s) = warningsAsErrors <- s
member fsc.VisualStudioStyleErrors member fsc.VisualStudioStyleErrors
with get() = vserrors with get() = vserrors
and set(p) = vserrors <- p and set(p) = vserrors <- p
...@@ -581,6 +581,9 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden ...@@ -581,6 +581,9 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
override fsc.GenerateFullPathToTool() = override fsc.GenerateFullPathToTool() =
if toolPath = "" then raise (new System.InvalidOperationException(FSBuild.SR.toolpathUnknown())) if toolPath = "" then raise (new System.InvalidOperationException(FSBuild.SR.toolpathUnknown()))
System.IO.Path.Combine(toolPath, fsc.ToolExe) System.IO.Path.Combine(toolPath, fsc.ToolExe)
override fsc.LogToolCommand (message:string) =
fsc.Log.LogMessageFromText(message, MessageImportance.Normal) |>ignore
member internal fsc.InternalGenerateFullPathToTool() = fsc.GenerateFullPathToTool() // expose for unit testing member internal fsc.InternalGenerateFullPathToTool() = fsc.GenerateFullPathToTool() // expose for unit testing
member internal fsc.BaseExecuteTool(pathToTool, responseFileCommands, commandLineCommands) = // F# does not allow protected members to be captured by lambdas, this is the standard workaround member internal fsc.BaseExecuteTool(pathToTool, responseFileCommands, commandLineCommands) = // F# does not allow protected members to be captured by lambdas, this is the standard workaround
base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands) base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands)
......
...@@ -358,7 +358,7 @@ private void BuildStartedHandler(object sender, BuildStartedEventArgs buildEvent ...@@ -358,7 +358,7 @@ private void BuildStartedHandler(object sender, BuildStartedEventArgs buildEvent
try try
{ {
this.haveCachedRegistry = false; this.haveCachedRegistry = false;
if (LogAtImportance(MessageImportance.Low)) if (LogAtImportance(MessageImportance.Normal))
{ {
LogEvent(sender, buildEvent); LogEvent(sender, buildEvent);
} }
...@@ -385,7 +385,7 @@ private void BuildFinishedHandler(object sender, BuildFinishedEventArgs buildEve ...@@ -385,7 +385,7 @@ private void BuildFinishedHandler(object sender, BuildFinishedEventArgs buildEve
{ {
try try
{ {
if (LogAtImportance(buildEvent.Succeeded ? MessageImportance.Low : if (LogAtImportance(buildEvent.Succeeded ? MessageImportance.Normal :
MessageImportance.High)) MessageImportance.High))
{ {
if (this.outputWindowPane != null) if (this.outputWindowPane != null)
...@@ -408,7 +408,7 @@ private void ProjectStartedHandler(object sender, ProjectStartedEventArgs buildE ...@@ -408,7 +408,7 @@ private void ProjectStartedHandler(object sender, ProjectStartedEventArgs buildE
{ {
try try
{ {
if (LogAtImportance(MessageImportance.Low)) if (LogAtImportance(MessageImportance.Normal))
{ {
LogEvent(sender, buildEvent); LogEvent(sender, buildEvent);
} }
...@@ -427,7 +427,7 @@ private void ProjectFinishedHandler(object sender, ProjectFinishedEventArgs buil ...@@ -427,7 +427,7 @@ private void ProjectFinishedHandler(object sender, ProjectFinishedEventArgs buil
{ {
try try
{ {
if (LogAtImportance(buildEvent.Succeeded ? MessageImportance.Low if (LogAtImportance(buildEvent.Succeeded ? MessageImportance.Normal
: MessageImportance.High)) : MessageImportance.High))
{ {
LogEvent(sender, buildEvent); LogEvent(sender, buildEvent);
...@@ -473,7 +473,7 @@ private void TargetFinishedHandler(object sender, TargetFinishedEventArgs buildE ...@@ -473,7 +473,7 @@ private void TargetFinishedHandler(object sender, TargetFinishedEventArgs buildE
{ {
--this.currentIndent; --this.currentIndent;
if ((isLogTaskDone) && if ((isLogTaskDone) &&
LogAtImportance(buildEvent.Succeeded ? MessageImportance.Low LogAtImportance(buildEvent.Succeeded ? MessageImportance.Normal
: MessageImportance.High)) : MessageImportance.High))
{ {
LogEvent(sender, buildEvent); LogEvent(sender, buildEvent);
...@@ -556,36 +556,37 @@ private void CustomHandler(object sender, CustomBuildEventArgs buildEvent) ...@@ -556,36 +556,37 @@ private void CustomHandler(object sender, CustomBuildEventArgs buildEvent)
/// This method takes a MessageImportance and returns true if messages /// This method takes a MessageImportance and returns true if messages
/// at importance i should be loggeed. Otherwise return false. /// at importance i should be loggeed. Otherwise return false.
/// </summary> /// </summary>
private bool LogAtImportance(MessageImportance importance) private bool LogAtImportance(MessageImportance importance)
{ {
// If importance is too low for current settings, ignore the event // If importance is too low for current settings, ignore the event
bool logIt = false; bool logIt = false;
this.SetVerbosity(); this.SetVerbosity();
switch (this.Verbosity) switch (this.Verbosity)
{ {
case LoggerVerbosity.Quiet: case LoggerVerbosity.Quiet:
logIt = false; logIt = false;
break; break;
case LoggerVerbosity.Minimal: case LoggerVerbosity.Minimal:
logIt = (importance == MessageImportance.High); logIt = (importance == MessageImportance.High);
break; break;
case LoggerVerbosity.Normal: case LoggerVerbosity.Normal:
// Falling through... logIt = (importance == MessageImportance.Normal) || (importance == MessageImportance.High);
case LoggerVerbosity.Detailed: break;
logIt = (importance != MessageImportance.Low); case LoggerVerbosity.Detailed:
break; logIt = (importance == MessageImportance.Low) || (importance == MessageImportance.Normal) || (importance == MessageImportance.High);
case LoggerVerbosity.Diagnostic: break;
logIt = true; case LoggerVerbosity.Diagnostic:
break; logIt = true;
default: break;
Debug.Fail("Unknown Verbosity level. Ignoring will cause everything to be logged"); default:
break; Debug.Fail("Unknown Verbosity level. Ignoring will cause everything to be logged");
} break;
}
return logIt;
} return logIt;
}
/// <summary> /// <summary>
/// This is the method that does the main work of logging an event /// This is the method that does the main work of logging an event
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册