Created
January 14, 2020 07:50
-
-
Save GroupDocsGists/9066fd74389e9e254ca6f47cb663c3c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/groupdocs-redaction/GroupDocs.Redaction-for-.NET | |
using GroupDocs.Redaction.Options; | |
/// <summary> | |
/// This is an example of ILogger implementation, tracking count of error messages. | |
/// </summary> | |
public class CustomLogger : ILogger | |
{ | |
public List<string> Errors { get; private set; } | |
public List<string> Traces { get; private set; } | |
public List<string> Warnings { get; private set; } | |
public bool HasErrors { get { return Errors.Count > 0; } } | |
public CustomLogger() | |
{ | |
Errors = new List<string>(); | |
Traces = new List<string>(); | |
Warnings = new List<string>(); | |
} | |
public void Error(string message) | |
{ | |
Errors.Add(message); | |
} | |
public void Trace(string message) | |
{ | |
Traces.Add(message); | |
} | |
public void Warning(string message) | |
{ | |
Warnings.Add(message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment