-
Notifications
You must be signed in to change notification settings - Fork 2
/
TaskLogger.cs
30 lines (23 loc) · 993 Bytes
/
TaskLogger.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
internal sealed class TaskLogger : Logger {
private AppDomainIsolatedTask _task;
public TaskLogger(AppDomainIsolatedTask task) {
_task = task;
}
public override void LogMessage(string message) {
_task.Log.LogMessage(MessageImportance.High, message);
}
public override void LogWarning(string file, string errorCode, string message, int line, int column) {
_task.Log.LogWarning(null, errorCode, null, file, line, column, line, column, message);
}
public override void LogError(string file, string errorCode, string message, int line, int column) {
_task.Log.LogError(null, errorCode, null, file, line, column, line, column, message);
Success = false;
}
public override void LogException(string file, Exception exception) {
_task.Log.LogErrorFromException(exception, true, true, file);
Success = false;
}
}