C# Class Aspectacular.LogOutputAspectBase

Use this class as a base for creating loggers - subclasses that take proxy log item collection and store them to whatever medium you need. Override Output(string) method in your subclasses to write the log text to the specific medium, Like Debug, Trace, log4net, Windows Event Log, etc.
Inheritance: Aspect
Datei anzeigen Open project: vgribok/Aspectacular

Public Properties

Property Type Description
entryTypeFilter EntryType
keys string[]
writeAllEntriesIfKeyFound bool

Public Methods

Method Description
Step_7_AfterEverythingSaidAndDone ( ) : void

Protected Methods

Method Description
FilterLogEntries ( List entries ) : IEnumerable

Whittles down log item collection according with values of entryTypeFilter, keys, and writeAllEntriesIfKeyFound.

GetTextEntries ( List entries ) : IEnumerable
LogOutputAspectBase ( EntryType typeOfEntriesToOutput, bool writeAllEntriesIfKeyFound, IEnumerable optionalKey ) : System

Initializes log output base class

Output ( string logText ) : void

Implement this method in the subclass to write actual log text to the destination.

Method Details

FilterLogEntries() protected method

Whittles down log item collection according with values of entryTypeFilter, keys, and writeAllEntriesIfKeyFound.
protected FilterLogEntries ( List entries ) : IEnumerable
entries List
return IEnumerable

GetTextEntries() protected method

protected GetTextEntries ( List entries ) : IEnumerable
entries List
return IEnumerable

LogOutputAspectBase() protected method

Initializes log output base class
protected LogOutputAspectBase ( EntryType typeOfEntriesToOutput, bool writeAllEntriesIfKeyFound, IEnumerable optionalKey ) : System
typeOfEntriesToOutput EntryType Desired combination of EntryType to filter items to be collected for outputting.
writeAllEntriesIfKeyFound bool /// If true and optionalKey is specified, the entire log collection is written if key is found in the collection. /// If false and optionalKey is specified, only log items with the key will be written. ///
optionalKey IEnumerable /// Optional item keys to output or to decide whether log collection needs to be written to /// output. All items are written if not specified. ///
return System

Output() protected abstract method

Implement this method in the subclass to write actual log text to the destination.
protected abstract Output ( string logText ) : void
logText string Text representing the log collection of the intercepted call.
return void

Step_7_AfterEverythingSaidAndDone() public method

public Step_7_AfterEverythingSaidAndDone ( ) : void
return void

Property Details

entryTypeFilter public_oe property

public EntryType entryTypeFilter
return EntryType

keys public_oe property

public string[] keys
return string[]

writeAllEntriesIfKeyFound public_oe property

public bool writeAllEntriesIfKeyFound
return bool