21
21
22
22
namespace Microsoft . Azure . Commands . RecoveryServices . Backup
23
23
{
24
+ /// <summary>
25
+ /// Utility for logging. Uses PS logging underneath.
26
+ /// Plan to add more functionality in the upcoming releases.
27
+ /// </summary>
24
28
public class Logger
25
29
{
26
30
private Action < string > writeWarningAction ;
@@ -33,6 +37,13 @@ public class Logger
33
37
34
38
public static Logger Instance { get ; set ; }
35
39
40
+ /// <summary>
41
+ /// Constructor. Takes the delegates for the various logging operations as input.
42
+ /// </summary>
43
+ /// <param name="writeWarning">Delegate to write warnings</param>
44
+ /// <param name="writeDebug">Delegate to write debug messages</param>
45
+ /// <param name="writeVerbose">Delegate to write verbose messages</param>
46
+ /// <param name="throwTerminatingError">Delegate to throw terminating errors</param>
36
47
public Logger ( Action < string > writeWarning ,
37
48
Action < string > writeDebug ,
38
49
Action < string > writeVerbose ,
@@ -44,21 +55,37 @@ public Logger(Action<string> writeWarning,
44
55
throwTerminatingErrorAction = throwTerminatingError ;
45
56
}
46
57
58
+ /// <summary>
59
+ /// Writes verbose message.
60
+ /// </summary>
61
+ /// <param name="text"></param>
47
62
public void WriteVerbose ( string text )
48
63
{
49
64
writeVerboseAction ( text ) ;
50
65
}
51
66
67
+ /// <summary>
68
+ /// Writes debug message.
69
+ /// </summary>
70
+ /// <param name="text"></param>
52
71
public void WriteDebug ( string text )
53
72
{
54
73
writeDebugAction ( text ) ;
55
74
}
56
75
76
+ /// <summary>
77
+ /// Writes warning message.
78
+ /// </summary>
79
+ /// <param name="text"></param>
57
80
public void WriteWarning ( string text )
58
81
{
59
82
writeWarningAction ( text ) ;
60
83
}
61
84
85
+ /// <summary>
86
+ /// Throws a terminating error.
87
+ /// </summary>
88
+ /// <param name="errorRecord"></param>
62
89
public void ThrowTerminatingError ( ErrorRecord errorRecord )
63
90
{
64
91
throwTerminatingErrorAction ( errorRecord ) ;
0 commit comments