Class MarkdownObserver
Markdown observer intended for end-user output
Inheritance
Namespace: PnP.Framework.Modernization.Telemetry.Observers
Assembly: PnP.Framework.dll
Syntax
public class MarkdownObserver : object, ILogObserver
Constructors
MarkdownObserver(String, String, Boolean, Boolean)
Constructor for specifying to include debug entries
Declaration
public MarkdownObserver(string fileName = "", string folder = "", bool includeDebugEntries = false, bool includeVerbose = false)
Parameters
|
System.String
fileName
Name used to construct the log file name |
|
System.String
folder
Folder that will hold the log file |
|
System.Boolean
includeDebugEntries
Include Debug Log Entries |
|
System.Boolean
includeVerbose
Include verbose details |
Fields
_includeDebugEntries
Declaration
protected bool _includeDebugEntries
Field Value
|
System.Boolean
|
_includeVerbose
Declaration
protected bool _includeVerbose
Field Value
|
System.Boolean
|
_pageBeingTransformed
Declaration
protected string _pageBeingTransformed
Field Value
|
System.String
|
_reportDate
Declaration
protected DateTime _reportDate
Field Value
|
DateTime
|
_reportFileName
Declaration
protected string _reportFileName
Field Value
|
System.String
|
_reportFolder
Declaration
protected string _reportFolder
Field Value
|
System.String
|
Properties
Logs
Get the single List<LogEntry> instance, singleton pattern
Declaration
public static List<Tuple<LogLevel, LogEntry>> Logs { get; }
Property Value
|
List<Tuple<LogLevel, LogEntry>>
|
Methods
Debug(LogEntry)
Debug level of data not recorded unless in debug mode
Declaration
public void Debug(LogEntry entry)
Parameters
|
LogEntry
entry
|
Implements
Error(LogEntry)
Flush()
Output the report when flush is called
Declaration
public virtual void Flush()
Implements
Flush(Boolean)
Output the report when flush is called
Declaration
public virtual void Flush(bool clearLogData)
Parameters
|
System.Boolean
clearLogData
Also clear the log data |
Implements
GenerateReportWithSummaryAtTop(Boolean)
Generates a markdown based report based on the logs
Declaration
protected virtual string GenerateReportWithSummaryAtTop(bool includeHeading = true)
Parameters
|
System.Boolean
includeHeading
|
Returns
|
System.String
|
GenerateReportWithSummaryAtTopDetails(StringBuilder, IEnumerable<Tuple<LogLevel, LogEntry>>)
Declaration
protected virtual string GenerateReportWithSummaryAtTopDetails(StringBuilder report, IEnumerable<Tuple<LogLevel, LogEntry>> distinctLogs)
Parameters
|
StringBuilder
report
|
|
IEnumerable<Tuple<LogLevel, LogEntry>>
distinctLogs
|
Returns
|
System.String
|
Info(LogEntry)
Reporting operations throughout the transform process
Declaration
public void Info(LogEntry entry)
Parameters
|
LogEntry
entry
|
Implements
SetPageId(String)
Sets the id of the page that's being transformed
Declaration
public void SetPageId(string pageId)
Parameters
|
System.String
pageId
Id of the page |
Implements
Warning(LogEntry)
Report on any warnings generated by the reporting tool
Declaration
public void Warning(LogEntry entry)
Parameters
|
LogEntry
entry
|