C# Класс GSF.Diagnostics.LogPublisher

A publisher of log messages.
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 LogEventPublisher.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.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
InitialStackMessages LogStackMessages
InitialStackTrace LogStackTrace

Открытые методы

Метод Описание
Publish ( MessageLevel level, MessageFlags flags, string eventName, string message = null, string details = null, Exception exception = null ) : void

Raises a log message with the provided data.

Publish ( MessageLevel level, string eventName, string message = null, string details = null, Exception exception = null ) : void

Raises a log message with the provided data.

RegisterEvent ( MessageLevel level, MessageFlags flags, string eventName ) : LogEventPublisher

Initializes an LogEventPublisher with the provided values.

RegisterEvent ( MessageLevel level, MessageFlags flags, string eventName, int stackTraceDepth, MessageRate messagesPerSecond, int burstLimit ) : LogEventPublisher

Initializes an LogEventPublisher with the provided values.

RegisterEvent ( MessageLevel level, string eventName ) : LogEventPublisher

Initializes an LogEventPublisher with the provided values.

RegisterEvent ( MessageLevel level, string eventName, int stackTraceDepth, MessageRate messagesPerSecond, int burstLimit ) : LogEventPublisher

Initializes an LogEventPublisher with the provided values.

ToString ( ) : string

Gets the full name of the type.

Приватные методы

Метод Описание
InternalRegisterEvent ( LogMessageAttributes attributes, string eventName ) : LogEventPublisherInternal

Initializes an LogEventPublisher with a series of settings.

InternalRegisterEvent ( LogMessageAttributes attributes, string eventName, int stackTraceDepth, MessageRate messagesPerSecond, int burstLimit ) : LogEventPublisherInternal

Initializes an LogEventPublisher with a series of settings.

InternalRegisterNewEvent ( LogMessageAttributes attributes, string eventName, int stackTraceDepth, double messagesPerSecond, int burstLimit ) : LogEventPublisherInternal
LogPublisher ( LoggerInternal logger, LogPublisherInternal publisherInstance, MessageClass classification ) : System

Описание методов

Publish() публичный Метод

Raises a log message with the provided data.
public Publish ( MessageLevel level, MessageFlags flags, string eventName, string message = null, string details = null, Exception exception = null ) : void
level MessageLevel the level of the message
flags MessageFlags associated flags
eventName string A short name about what this message is detailing. Typically this will be a few words.
message string A longer message than giving more specifics about the actual message. /// Typically, this will be up to 1 line of text.
details string A long text field with the details of the message.
exception System.Exception An exception object if one is provided.
Результат void

Publish() публичный Метод

Raises a log message with the provided data.
public Publish ( MessageLevel level, string eventName, string message = null, string details = null, Exception exception = null ) : void
level MessageLevel the level of the message
eventName string A short name about what this message is detailing. Typically this will be a few words.
message string A longer message than giving more specifics about the actual message. /// Typically, this will be up to 1 line of text.
details string A long text field with the details of the message.
exception System.Exception An exception object if one is provided.
Результат void

RegisterEvent() публичный Метод

Initializes an LogEventPublisher with the provided values.
public RegisterEvent ( MessageLevel level, MessageFlags flags, string eventName ) : LogEventPublisher
level MessageLevel the level of the message
flags MessageFlags associated flags
eventName string the name of the event.
Результат LogEventPublisher

RegisterEvent() публичный Метод

Initializes an LogEventPublisher with the provided values.
public RegisterEvent ( MessageLevel level, MessageFlags flags, string eventName, int stackTraceDepth, MessageRate messagesPerSecond, int burstLimit ) : LogEventPublisher
level MessageLevel the level of the message
flags MessageFlags associated flags
eventName string
stackTraceDepth int
messagesPerSecond MessageRate
burstLimit int
Результат LogEventPublisher

RegisterEvent() публичный Метод

Initializes an LogEventPublisher with the provided values.
public RegisterEvent ( MessageLevel level, string eventName ) : LogEventPublisher
level MessageLevel the level of the message and associated flags if any
eventName string the name of the event.
Результат LogEventPublisher

RegisterEvent() публичный Метод

Initializes an LogEventPublisher with the provided values.
public RegisterEvent ( MessageLevel level, string eventName, int stackTraceDepth, MessageRate messagesPerSecond, int burstLimit ) : LogEventPublisher
level MessageLevel the level of the message
eventName string
stackTraceDepth int
messagesPerSecond MessageRate
burstLimit int
Результат LogEventPublisher

ToString() публичный Метод

Gets the full name of the type.
public ToString ( ) : string
Результат string

Описание свойств

InitialStackMessages публичное свойство

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 LogStackMessages InitialStackMessages
Результат LogStackMessages

InitialStackTrace публичное свойство

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.
public LogStackTrace InitialStackTrace
Результат LogStackTrace