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
Afficher le fichier Open project: vgribok/Aspectacular

Méthodes publiques

Свойство Type Description
entryTypeFilter EntryType
keys string[]
writeAllEntriesIfKeyFound bool

Méthodes publiques

Méthode Description
Step_7_AfterEverythingSaidAndDone ( ) : void

Méthodes protégées

Méthode 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 méthode

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

GetTextEntries() protected méthode

protected GetTextEntries ( List entries ) : IEnumerable
entries List
Résultat IEnumerable

LogOutputAspectBase() protected méthode

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. ///
Résultat System

Output() protected abstract méthode

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.
Résultat void

Step_7_AfterEverythingSaidAndDone() public méthode

public Step_7_AfterEverythingSaidAndDone ( ) : void
Résultat void

Property Details

entryTypeFilter public_oe property

public EntryType entryTypeFilter
Résultat EntryType

keys public_oe property

public string[] keys
Résultat string[]

writeAllEntriesIfKeyFound public_oe property

public bool writeAllEntriesIfKeyFound
Résultat bool