aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2020-05-08 21:54:44 +1000
committerSean Hall <r.sean.hall@gmail.com>2020-05-08 22:11:35 +1000
commitd840580127d99bf817332711f8a9c833f395d387 (patch)
treeee37a737f334ae5f7994d535f91cded869a31a79 /src
parent70d112fb1ec23597b6365c3f80eec695c013960b (diff)
downloadwix-d840580127d99bf817332711f8a9c833f395d387.tar.gz
wix-d840580127d99bf817332711f8a9c833f395d387.tar.bz2
wix-d840580127d99bf817332711f8a9c833f395d387.zip
Add support for Verbose in MsbuildMessageListener.
Diffstat (limited to 'src')
-rw-r--r--src/WixToolset.BuildTasks/DoIt.cs29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs
index ad89cc2c..757c5313 100644
--- a/src/WixToolset.BuildTasks/DoIt.cs
+++ b/src/WixToolset.BuildTasks/DoIt.cs
@@ -253,27 +253,32 @@ namespace WixToolset.BuildTasks
253 253
254 public void Write(Message message) 254 public void Write(Message message)
255 { 255 {
256 var code = this.ShortAppName + message.Id.ToString();
257 var file = message.SourceLineNumbers?.FileName ?? this.LongAppName;
258 var lineNumber = message.SourceLineNumbers?.LineNumber ?? 0;
256 switch (message.Level) 259 switch (message.Level)
257 { 260 {
258 case MessageLevel.Error: 261 case MessageLevel.Error:
259 this.Logger.LogError(null, this.ShortAppName + message.Id.ToString(), null, message.SourceLineNumbers?.FileName ?? this.LongAppName, message.SourceLineNumbers?.LineNumber ?? 0, 0, 0, 0, message.ResourceNameOrFormat, message.MessageArgs); 262 this.Logger.LogError(null, code, null, file, lineNumber, 0, 0, 0, message.ResourceNameOrFormat, message.MessageArgs);
263 break;
264
265 case MessageLevel.Verbose:
266 this.Logger.LogMessage(null, code, null, file, lineNumber, 0, 0, 0, MessageImportance.Low, message.ResourceNameOrFormat, message.MessageArgs);
260 break; 267 break;
261 268
262 case MessageLevel.Warning: 269 case MessageLevel.Warning:
263 this.Logger.LogWarning(null, this.ShortAppName + message.Id.ToString(), null, message.SourceLineNumbers?.FileName ?? this.LongAppName, message.SourceLineNumbers?.LineNumber ?? 0, 0, 0, 0, message.ResourceNameOrFormat, message.MessageArgs); 270 this.Logger.LogWarning(null, code, null, file, lineNumber, 0, 0, 0, message.ResourceNameOrFormat, message.MessageArgs);
264 break; 271 break;
265 272
266 default: 273 default:
267 // TODO: Revisit this because something is going horribly awry. The commented out LogMessage call is crashing saying that the "message" parameter is null. When you look at the call stack, the code 274 if (message.Id > 0)
268 // is in the wrong LogMessage override and the "null" subcategory was passed in as the message. Not clear why it is picking the wrong overload. 275 {
269 //if (message.Id > 0) 276 this.Logger.LogMessage(null, code, null, file, lineNumber, 0, 0, 0, MessageImportance.Normal, message.ResourceNameOrFormat, message.MessageArgs);
270 //{ 277 }
271 // this.Logger.LogMessage(null, code, null, message.SourceLineNumber?.FileName, message.SourceLineNumber?.LineNumber ?? 0, 0, 0, 0, MessageImportance.Normal, message.Format, message.FormatData); 278 else
272 //} 279 {
273 //else 280 this.Logger.LogMessage(MessageImportance.Normal, message.ResourceNameOrFormat, message.MessageArgs);
274 //{ 281 }
275 this.Logger.LogMessage(MessageImportance.Normal, message.ResourceNameOrFormat, message.MessageArgs);
276 //}
277 break; 282 break;
278 } 283 }
279 } 284 }