LogWriter

This class routes log messages to LogTargets based on categories.

Namespace:
Inetdev.Diagnostics
Type:
Class
Public:
Yes
Protected:
No
Sealed:
Yes
Abstract:
No
Inherits from:
System.Object

Constructors

LogWriter

Initializes a new LogWriter with the specified LogTargets, a Warning minimum level and Basic default category.

Signature:
public Void LogWriter(logTargets)
Parameters
Name Type Summary
logTargets ICollection<LogTarget> A collection of LogTargets.

LogWriter

Initializes a new LogWriter with the specified LogTargets, a Warning minimum level and the specified defaultCategory.

Signature:
public Void LogWriter(defaultCategory, logTargets)
Parameters
Name Type Summary
defaultCategory String Default category for log entries.
logTargets ICollection<LogTarget> A collection of LogTargets.

LogWriter

Initializes a new LogWriter with the specified LogTargets, ant the specified minimumLevel and defaultCategory.

Signature:
public Void LogWriter(minimumLevel, defaultCategory, logTargets)
Parameters
Name Type Summary
minimumLevel LogLevel Minimum entry level to be writter.
defaultCategory String Default category for log entries.
logTargets ICollection<LogTarget> A collection of LogTargets.

Properties

DefaultCategory

Default LogEntry category.

Signature:
public String DefaultCategory { get; set; }

LogTargets

A collection of LogTargets to write the entries to.

Signature:
public ICollection<LogTarget> LogTargets { get; set; }

MinimumLevel

Minimum entry level to be written.

Signature:
public LogLevel MinimumLevel { get; set; }

Methods

ShouldLog

Queries whether the entry should be logged.

Signature:
public Boolean ShouldLog(entry)
Returns

true if the entry should be written, otherwise false.

Parameters
Name Type Summary
entry LogEntry An LogEntry to be checked.

ToString

Returns a textual representation of the Log Writer.

Signature:
public String ToString()

Write

Write the specified log entry.

Signature:
public Void Write(entry)
Parameters
Name Type Summary
entry LogEntry An LogEntry to be written.