Click or drag to resize

LogPublisher Class

A publisher of log messages.
Inheritance Hierarchy
SystemObject
  GSF.DiagnosticsLogPublisher

Namespace: GSF.Diagnostics
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.205-beta+5ef4169f3b1079d8b163dd363614f656bd140924
Syntax
public class LogPublisher
View Source

The LogPublisher type exposes the following members.

Properties
 NameDescription
Public propertyMaxDistinctEventPublisherCount The maximum number of distinct events that this publisher can generate. (Default: 20)
Top
Methods
 NameDescription
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodPublish(MessageLevel, String, String, String, Exception) Raises a log message with the provided data.
Public methodPublish(MessageLevel, MessageFlags, String, String, String, Exception) Raises a log message with the provided data.
Public methodRegisterEvent(MessageLevel, String) Initializes an LogEventPublisher with the provided values.
Public methodRegisterEvent(MessageLevel, MessageFlags, String) Initializes an LogEventPublisher with the provided values.
Public methodRegisterEvent(MessageLevel, String, Int32, MessageRate, Int32) Initializes an LogEventPublisher with the provided values.
Public methodRegisterEvent(MessageLevel, MessageFlags, String, Int32, MessageRate, Int32) Initializes an LogEventPublisher with the provided values.
Public methodToString Gets the full name of the type.
(Overrides ObjectToString)
Top
Fields
 NameDescription
Public fieldInitialStackMessages The stack messages that existed when this publisher was created. This can be modified by the user of this publisher. Any messages that get published by this class will automatically have this data added to the log message.
Public fieldInitialStackTrace The stack trace that existed when this publisher was created. This can be modified by the user of this publisher. Any messages that get published by this class will automatically have this data added to the log message.
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
Remarks
InitialStackMessages and InitialStackTrace can be modified so messages that are generated with this instance will have this data appended to the log message. The user can either call one of the Publish overloads to lazily publish a message, or they can register a message with RegisterEvent so calling this message will incur little overhead. If registering an event, the user can check HasSubscribers to determine if the log message can be skipped altogether. Registering events also allows the user to specify the auto-suppression algorithm and the depth of the stack trace that will be recorded on a message being raised.
See Also