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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
using System;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace AggregateConfigBuildTask
{
/// <inheritdoc />
public class TaskLogger : ITaskLogger
{
/// <summary>
/// Gets the underlying TaskLoggingHelper.
/// </summary>
public TaskLoggingHelper Log { get; }
/// <summary>
/// Initializes a new instance of the <see cref="TaskLogger"/> class.
/// </summary>
/// <param name="task">The task that will be used for logging.</param>
public TaskLogger(TaskLoggingHelper task)
{
Log = task ?? throw new ArgumentNullException(nameof(task));
}
/// <inheritdoc />
public void LogError(string message = null, params object[] messageArgs)
{
Log.LogError(message ?? "Unknown Error", messageArgs);
}
/// <inheritdoc />
public void LogErrorFromException(Exception exception,
bool showStackTrace = false,
bool showDetail = false,
string file = null)
{
Log.LogErrorFromException(exception, showStackTrace, showDetail, file);
}
/// <inheritdoc />
public void LogWarning(string message = null, params object[] messageArgs)
{
Log.LogWarning(message, messageArgs);
}
/// <inheritdoc />
public void LogWarning(
string subcategory = null,
string warningCode = null,
string helpKeyword = null,
string file = null,
int lineNumber = 0,
int columnNumber = 0,
int endLineNumber = 0,
int endColumnNumber = 0,
string message = null,
params object[] messageArgs)
{
Log.LogWarning(
subcategory,
warningCode,
helpKeyword,
file,
lineNumber,
columnNumber,
endLineNumber,
endColumnNumber,
message,
messageArgs);
}
/// <inheritdoc />
public void LogMessage(MessageImportance importance = MessageImportance.Normal, string message = null, params object[] messageArgs)
{
Log.LogMessage(importance, message, messageArgs);
}
}
}
|