Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created January 14, 2020 07:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/9066fd74389e9e254ca6f47cb663c3c8 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/9066fd74389e9e254ca6f47cb663c3c8 to your computer and use it in GitHub Desktop.
// 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